[Python-Dev] dict containment annoyance (original) (raw)
Georg Brandl g.brandl at gmx.net
Sat Aug 12 20:10:54 CEST 2006
- Previous message: [Python-Dev] NotHashableError? (Re: dict containment annoyance)
- Next message: [Python-Dev] Fwd: [Python-checkins] r51236 - in python/trunk: Doc/api/abstract.tex Include/abstract.h Include/object.h Lib/test/test_index.py Misc/NEWS Modules/arraymodule.c Modules/mmapmodule.c Modules/operator.c Objects/abstract.c Objects/classobject.c Objects/
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] NotHashableError? (Re: dict containment annoyance)
- Next message: [Python-Dev] Fwd: [Python-checkins] r51236 - in python/trunk: Doc/api/abstract.tex Include/abstract.h Include/object.h Lib/test/test_index.py Misc/NEWS Modules/arraymodule.c Modules/mmapmodule.c Modules/operator.c Objects/abstract.c Objects/classobject.c Objects/
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]