[Python-Dev] re: for in dict (user expectation poll)

Fredrik Lundh fredrik@pythonware.com
Mon, 5 Feb 2001 22:02:42 +0100


> But then we should review the wisdom of using "if x in dict" as a
> shortcut for "if dict.has_key(x)" again.  Everything is tied together!

yeah, don't forget unpacking assignments:

    assert len(dict) == 3
    { k1:v1, k2:v2, k3:v3 } = dict

Cheers /F