2.2 features

Andrew Kuchling akuchlin at mems-exchange.org
Tue Jul 31 21:36:51 EDT 2001


aahz at panix.com (Aahz Maruch) writes:
> 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.

Plus it's actually would be wrong, I think.  'in' uses the ==
operator, so that expression returns true if the object x is the int
or long type object.  Do we want to explain that 'x in int' and 'x in
[int,long]' do quite different things?

+1 on ripping 'x in int' out of CVS.  Like children, it's sorta cute
at first glance but becomes annoying after longer acquaintance and
contemplation.

--amk



More information about the Python-list mailing list