This paste expires on 2023-04-03 20:18:00.110899. Repaste, or download this paste. . Pasted through web.

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))
Filename: None. Size: 337b. View raw, , hex, or download this file.