2.2 features

Guido van Rossum guido at zope.com
Tue Jul 31 13:05:06 EDT 2001


>     Guido> I love it.  'x in type' as a shorthand for isinstance(x, type).
>     Guido> Checked into CVS!
> 
> How about 'x in type' as a shorthand for 'issubclass(x, type)' if x is a
> type or class instead of an instance?

No, that would be ambiguous.  A subclass is not an instance.  A class
or type represents a set of instances, so 'in' is justified in a
sense.

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list