[Python-Dev] Weak Dictionary Iteration Behavior in Python 3

Scott David Daniels Scott.Daniels at Acm.Org
Sun Sep 14 02:21:36 CEST 2008

Josiah Carlson wrote:
> On Sat, Sep 13, 2008 at 1:20 PM, Armin Ronacher wrote:
>> Iterating over weak key dictionaries might not be the most common task but I
>> know some situations where this is necessary.  Unfortunately I can't see a
>> way to achieve that in Python 3.
> i = list(d.keys())

     i = list(d)
is a more reasonable way to do this.  I seldom find a reason
to use .keys

--Scott David Daniels
Scott.Daniels at Acm.Org

More information about the Python-Dev mailing list