dictionaries and 'in' in 2.1
Just van Rossum
just at letterror.com
Sun Nov 4 02:48:58 EST 2001
More information about the Python-list mailing list
Sun Nov 4 02:48:58 EST 2001
- Previous message (by thread): dictionaries and 'in' in 2.1
- Next message (by thread): Jews or Muslims? Who's a better hacker? Or phreaker?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Sean 'Shaleh' Perry wrote: > > On 03-Nov-2001 John J. Lee wrote: > > > > The Python 2.1.1 manual, section 2.1.6, says: > > > > k in a 1 if a has a key k, else 0 > > k not in a 0 if a has a key k, else 1 > > > > > > Odd, I thought you had to do "key in dict.keys()". That's the *last* thing you had to do: it's a linear search. The pre-2.2 equivalent to "key in dict" is "dict.has_key(key)". Just
- Previous message (by thread): dictionaries and 'in' in 2.1
- Next message (by thread): Jews or Muslims? Who's a better hacker? Or phreaker?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list