2.2 features

Ken Seehof kseehof at neuralintegrator.com
Tue Jul 31 07:16:23 EDT 2001


From: "Guido van Rossum" <guido at python.org>

> I love it.  'x in type' as a shorthand for isinstance(x, type).
> Checked into CVS!

Very cool.  While you're at it, how about mapping "in" to "has_key" for
mapping objects?

>>> 'parrot' in {'parrot': 'dead'}
1
>>> 'dead' in {'parrot': 'dead'}  # obviously "in" refers to keys, not
values
0

BTW, thanks again for the awesome language.
I hereby revoke the title ".*[dD]ictator".  I dub thee "Fearless Leader".

Your loyal, trusting subject,
Ken Seehof






More information about the Python-list mailing list