[Python-Dev] Sets: elt in dict, lst.include - really begs for a PEP
Barry A. Warsaw
Mon, 29 Jan 2001 23:13:24 -0500
>>>>> "SM" == Skip Montanaro <firstname.lastname@example.org> writes:
SM> it seems to me that the whole "if/for something in dict" thing
SM> needds to be hashed out in a PEP.
SM> There are apparently lots of varying opinions about what's
SM> reasonable. This topic seems related to PEP 212 (Loop Counter
SM> Iteration) and PEP 218 (Adding a Built-In Set Object Type),
SM> but may well warrant its own.
As keeper of PEP0, I have to agree. I personally would vastly prefer
a new iterator protocol than syntax such as "for key:value in dict".
I'd really like to see a PEP on an iterator protocol for Python, but
like Skip, I'm too busy at the moment to do it myself. If nobody
takes it on before then, I might be willing to champion such a PEP for
the 2.2 time frame. Until then, I'm decidedly -1 on "for/if in dict".