2.2 features

Aahz Maruch aahz at panix.com
Tue Jul 31 20:31:28 EDT 2001


In article <cpae1lzio7.fsf at cj20424-a.reston1.va.home.com>,
Guido van Rossum  <guido at python.org> wrote:
>Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl> writes:
>>
>> Now thow in 'isinstance' as an old way to spell a specific membership
>> test (for types and classes) which doesn't have to be learned about
>> at all.
>
>I love it.  'x in type' as a shorthand for isinstance(x, type).
>Checked into CVS!

After seeing all the confusion about whether 'x in type' means
isinstance() or issubclass(), my preference is for ripping this change
out of CVS.  The only way in which I think the 'in' operator makes sense
is if you're trying to do

    if x in [int, long]:

which starts being rather ugly as the only reason for an idiom's
existence.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"activist for accuracy"  --SJM



More information about the Python-list mailing list