Message161712
> 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. |
|
Date |
User |
Action |
Args |
2012-05-27 16:52:35 | rhettinger | set | recipients:
+ rhettinger, ezio.melotti, mrabarnett, fgracia |
2012-05-27 16:52:35 | rhettinger | set | messageid: <1338137555.04.0.766746560495.issue14924@psf.upfronthosting.co.za> |
2012-05-27 16:52:34 | rhettinger | link | issue14924 messages |
2012-05-27 16:52:34 | rhettinger | create | |
|