2.2 features

Guido van Rossum guido at zope.com
Thu Aug 2 08:29:57 EDT 2001


> >   if x in list: ...
> > 
> > looks a lot more confusing.  I may withdraw this idea.
> 
> I'd think again.  The problem with isinstance and issubclass is that I
> can never remember the order of the arguments.  Something
> non-symmetric like "x in type" is much clearer to me, to read and to
> write.

Yes, it's clearer, but it leads to hypergeneralization (dare I ever
use that word again? :-).

To remember isinstance() and isclass(), try to make a sentence out of
it, like isinstance(x, y) <==> x is instance [of] y.

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




More information about the Python-list mailing list