
Sure, you could use ``iter(())`` or ``iter([])``, but for consistency's sake wouldn't it make sense for ``iter()`` to return an empty iterator, as ``str()`` returns an empty string etc.? Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.

Georg Brandl wrote:
I had no idea that "str()" or "int()" would do that. "file()" certainly doesn't! :) I don't really think there's much reason to make "iter()" work. As you say, "iter([])" works just fine. For those rare times you want an empty iterator, I don't think the two extra characters is much of a price to pay. -Andrew.

Georg Brandl wrote:
I had no idea that "str()" or "int()" would do that. "file()" certainly doesn't! :) I don't really think there's much reason to make "iter()" work. As you say, "iter([])" works just fine. For those rare times you want an empty iterator, I don't think the two extra characters is much of a price to pay. -Andrew.
participants (3)
-
Andrew Bennetts
-
Georg Brandl
-
Ron Adam