[issue11406] There is no os.listdir() equivalent returning generator instead of list

Antoine Pitrou report at bugs.python.org
Sun Mar 13 00:47:24 CET 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

> I would like to have an iterator version as well, but I also dislike
> another function (especially the "x" prefix). How about adding a
> keyword argument to select iterator behaviour?

Changing the return type based on an argument is generally frown upon
so, if anything, I think it would be better to have a separate function
(whatever its name).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11406>
_______________________________________


More information about the Python-bugs-list mailing list