2.2 features

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Tue Jul 31 11:47:59 EDT 2001


Tue, 31 Jul 2001 09:21:40 -0500, Skip Montanaro <skip at pobox.com> pisze:

>     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?

Bad idea because it overlaps with the previous. You could not check
whether an object is an instance of some class (because of false
positives for objects representing its subclasses) nor whether it's
a subclass (because of false positives for instances).

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list