retry in try:...except:
Dan Parisien
dan at eevolved.com
Sun Feb 11 17:09:20 EST 2001
More information about the Python-list mailing list
Sun Feb 11 17:09:20 EST 2001
- Previous message (by thread): retry in try:...except:
- Next message (by thread): retry in try:...except:
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Fredrik Lundh wrote: > Dan Parisien wrote: > while 1: > try: > something() > except: > fix_possible_error() > else: > break that's what I ended up doing as a work-around. much less readable however > for item in list: > do_something(item) No. I want the indexes instead of using range(len(list)) over and over > (or "def indexes(list): return range(len(list))") I know ;) but why code it over and over in each script you need it? I am a big fan of code reuse. Every time I write something twice, I have a bad gut feeling because I know I'm doing it uselessly :( Dan
- Previous message (by thread): retry in try:...except:
- Next message (by thread): retry in try:...except:
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list