Antoine Pitrou <pit...@free.fr> added the comment:

At least equally useful would be the mention that __iter__ can be a generator, 
eliminating the need for intermediate objects:

>>> class C:
...     def __iter__(self):
...         yield 1
...         yield 2
... 
>>> list(C())
[1, 2]

----------
nosy: +pitrou

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

Reply via email to