Enumerate object is destroyed by casting?

Nick Jacobson nicksjacobson at yahoo.com
Wed Aug 25 22:07:20 CEST 2004


Casting an 'enumerate' object destroys it??  Is that supposed to
happen, or is it a bug?


For example:
a = ['a', 'b', 'c']
e = enumerate(a)
print dict(e)
print dict(e)


Result:
{0: 'a', 1: 'b', 2: 'c'}
{}



More information about the Python-list mailing list