On Apr 4, 2006, at 11:41 PM, Alex Martelli wrote: > IMHO, the solution to THAT very real problem is to supply a built-in > function that catches some exceptions and maps them into suitable > return values. Simplest would be something like: [...] > though I'm sure we can get better syntax if we turn 'catch' into some > kind of syntactic special form. My point is that there are umpteen > predicates one can write which would have to be distorted to ensure > they can't raise -- better to let them raise if they must, and allow > catching the expected exception(s), somewhat like this example.
And while you're at it, how about some syntax to use try/finally and while inside expressions too. That will complete the duplication of flow control syntax between statement and expression form. James _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com