Message253690
| Author |
yoch.melka |
| Recipients |
yoch.melka |
| Date |
2015年10月29日.19:38:24 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1446147504.48.0.238943227833.issue25513@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
collections.abc.Iterable don't implement the __bool__ method. This may seriously degrade performance in case __len__ is not efficient.
I suggest to implement it as :
class Iterable:
...
def __bool__(self):
try:
next(iter(self))
return True
except StopIteration:
return False |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2015年10月29日 19:38:24 | yoch.melka | set | recipients:
+ yoch.melka |
| 2015年10月29日 19:38:24 | yoch.melka | set | messageid: <1446147504.48.0.238943227833.issue25513@psf.upfronthosting.co.za> |
| 2015年10月29日 19:38:24 | yoch.melka | link | issue25513 messages |
| 2015年10月29日 19:38:24 | yoch.melka | create |
|