| class LenghtyZip(zip):
|
| def __new__(cls, *iterables, strict = False):
|
| self = super().__new__(cls, *iterables, strict = strict)
|
| self.__iterables = iterables
|
| return self
|
|
|
| def __len__(self):
|
| # Let the TypeError bubble
|
| return min(len(it) for it in self.__iterables)
|
|
|
|
|
| z = LenghtyZip(range(10), range(15))
|
| print(len(z))
|