Message253691
| Author |
r.david.murray |
| Recipients |
r.david.murray, yoch.melka |
| Date |
2015年10月29日.19:51:00 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1446148260.68.0.416827252598.issue25513@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
This is as designed. The only method needed for something to qualify as an Iterable is __iter__, thus this is the only method defined on the ABC. If you want your Iterable to be usable in a boolean test, add the __bool__ method to your concrete class.
In fact, you will note that no ABCs define __bool__.
Likewise __len__ is not part of being an Iterator, and in fact in the general case Iterators do not have a len (a given Iterator might be infinite, or it might not be practical to calculate the len). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年10月29日 19:51:00 | r.david.murray | set | recipients:
+ r.david.murray, yoch.melka |
| 2015年10月29日 19:51:00 | r.david.murray | set | messageid: <1446148260.68.0.416827252598.issue25513@psf.upfronthosting.co.za> |
| 2015年10月29日 19:51:00 | r.david.murray | link | issue25513 messages |
| 2015年10月29日 19:51:00 | r.david.murray | create |
|