[Python-Dev] dict containment annoyance (original) (raw)

Georg Brandl g.brandl at gmx.net
Sat Aug 12 20:10:54 CEST 2006


tomer filiba wrote:

[Aahz]

-1

This is seriously no different from an attempt to do >>> a = {} >>> a[ [] ] = 1 how so? i'm not trying to modify/store anything in a dict. i'm only testing if a certain object is contained in the dict. that's totally different. imagine this: x = 6 x < 2 am i trying to modify 'x' in any way? i'm only testing if x is less than 2.

The correct analogon is

x = [] x < 2

which currently works in Python, but won't in 3.0.

Georg



More information about the Python-Dev mailing list