Message271954
Ahh, I see. In that case, if the object passed-in has a length, use that. If not, then raise TypeError. e.g. proposed behavior:
>>> len(itertool.combinations(range(10), 2))
45
>>> len(itertool.combinations(iter(range(10)), 2))
...
TypeError: itertools.combinations underlying object has no len() |
|
Date |
User |
Action |
Args |
2016-08-04 07:54:58 | Claudiu Saftoiu | set | recipients:
+ Claudiu Saftoiu, rhettinger, xiang.zhang |
2016-08-04 07:54:58 | Claudiu Saftoiu | set | messageid: <1470297298.72.0.0111007948787.issue27678@psf.upfronthosting.co.za> |
2016-08-04 07:54:58 | Claudiu Saftoiu | link | issue27678 messages |
2016-08-04 07:54:58 | Claudiu Saftoiu | create | |
|