Re: retry in exception

2006-09-30 Thread Steve Holden
Sybren Stuvel wrote: > Antoine De Groote enlightened us with: > >>I hope I don't upset anybody by comparing Python to Ruby (again). Is >>there something like Ruby's retry keyword in Python? > > > Please don't assume that everybody knows Ruby through and through... > I didn't see any such assum

Re: retry in exception

2006-09-29 Thread MonkeeSage
Everyone wrote: > [cool stuff] Ps. I've only used retry a handful of times in about 3 or 4 years of using ruby; I wasn't advocating it or criticizing python, just trying to explain the OPs request. Regards, Jordan -- http://mail.python.org/mailman/listinfo/python-list

Re: retry in exception

2006-09-29 Thread Tim Chase
> In ruby, the equivalent to try...except is begin...rescue. In the > rescue section you can ask it to retry the begin section. So, for > example: > > b=0 > begin > puts 1/b > rescue > b=1 > retry # <- this little guy > end Well, it's all a matter of how you look at it. I personally pref

Re: retry in exception

2006-09-29 Thread Fredrik Lundh
MonkeeSage wrote: > I don't think python has any equivalent (could be wrong). a trivial combination of while and try/except/else does the trick: n = 0 while 1: try: # do something print n n = n + 1 # make sure it fails a couple of times if n < 10:

Re: retry in exception

2006-09-29 Thread Diez B. Roggisch
MonkeeSage schrieb: > Sybren Stuvel wrote: >> Antoine De Groote enlightened us with: >>> I hope I don't upset anybody by comparing Python to Ruby (again). Is >>> there something like Ruby's retry keyword in Python? >> Please don't assume that everybody knows Ruby through and through... > > In ruby

Re: retry in exception

2006-09-29 Thread MonkeeSage
Sybren Stuvel wrote: > Antoine De Groote enlightened us with: > > I hope I don't upset anybody by comparing Python to Ruby (again). Is > > there something like Ruby's retry keyword in Python? > > Please don't assume that everybody knows Ruby through and through... In ruby, the equivalent to try...

Re: retry in exception

2006-09-29 Thread Sybren Stuvel
Antoine De Groote enlightened us with: > I hope I don't upset anybody by comparing Python to Ruby (again). Is > there something like Ruby's retry keyword in Python? Please don't assume that everybody knows Ruby through and through... Sybren -- Sybren Stüvel Stüvel IT - http://www.stuvel.eu/ -

retry in exception

2006-09-29 Thread Antoine De Groote
Hi, I hope I don't upset anybody by comparing Python to Ruby (again). Is there something like Ruby's retry keyword in Python? I couldn't find any thing... Regards, antoine -- http://mail.python.org/mailman/listinfo/python-list