[issue14924] re.finditer() oddity

Raymond Hettinger report at bugs.python.org
Sun May 27 18:52:35 CEST 2012


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> All iterators are always true,

More generally, all objects are true by default.  The only false objects in Python are None; container-like objects with a __len__ that returns zero; and number-like objects with a __nonzero__ method that returns False.

Guido decided that iterators should not be treated like containers and should not have a __len__ method.

----------
nosy: +rhettinger

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


More information about the Python-bugs-list mailing list