[Python-Dev] Should issubclass() be more like isinstance()?

James Y Knight foom at fuhm.net
Wed Apr 5 06:59:41 CEST 2006


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


More information about the Python-Dev mailing list