2.2 features

Paul Prescod paulp at ActiveState.com
Fri Aug 3 09:00:30 EDT 2001


Greg Ewing wrote:
> 
>...
> 
> How about
> 
>    x in class c
> 
> for isinstance, and
> 
>    class c1 in class c2
> 
> for issubclass?

I think that's very easy to read. And it solves the problem I'm not
supposed to mention:

try:
  foo()
except x in class ZeroDivisionError:
  bar()

-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook




More information about the Python-list mailing list