RE: [Python-Dev] PEP 276 (simple iterator for ints)

July 4, 2004
4:31 p.m.
Andrew Koenig wrote:
Hmm - time to propose a new builtin (can't remember this being proposed before, though I know we've discussed adding keys() to lists). keys(mapping) Returns an iterator of the keys of the mapping. For any sequence that implements __len__, returns an iterator of the integers 0..__len__. For any object that implements keys() or iterkeys(), returns the appropriate iterator. I would also suggest that __keys__ might be a useful magic method. There might be a use for values(mapping) as well, but I don't think it's as useful. Tim Delaney
7557
Age (days ago)
7557
Last active (days ago)
0 comments
1 participants
participants (1)
-
Delaney, Timothy C (Timothy)