Message253690
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 |
|
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 | |
|