Status of PEP's?

Delaney, Timothy tdelaney at avaya.com
Mon Mar 4 20:19:38 EST 2002


> From: David Eppstein [mailto:eppstein at ics.uci.edu]
>
> For the same reason that
>     for item in list
> works but
>     for dictionary.has_key(item)
> doesn't:  The for-loop syntax only allows a very restricted set of 

Just realised something for PEP 276.

If it passes,

for i in dictionary.has_key(item):

would then be valid ... as it would return 0 or 1. This may or may not be
considered a bad thing - it would be equivalent to:

if dictionary.has_key(item):

for any condition that does return 0 or 1.

Tim Delaney




More information about the Python-list mailing list