Akira Kitada <akit...@gmail.com> added the comment:

Attached is a patch that adds the iterator protocol.
Now it can be interated through like:

>>> for k in d: print k, d[k]
... 
key1 vale1
key3 vale3
key0 vale0
key2 vale2
key4 vale4

The problem is there is no way to get the internal pointer back to the
start. So Once it reached to the end, you are done.

>>> for k in d: print k, d[k]
...

The solution to this would be:
- Add a method to get the pointer back to the start
  (with {first,next}key API)
- Add a method that returns a generator

----------
keywords: +patch
Added file: http://bugs.python.org/file13673/issue5736.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5736>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to