mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-14 20:33:19 +00:00
Add __len__ to PagedLists
This commit is contained in:
parent
bd2d82a5d3
commit
dd26ced164
|
@ -1172,6 +1172,10 @@ def __init__(self, pagefunc, pagesize):
|
||||||
self._pagefunc = pagefunc
|
self._pagefunc = pagefunc
|
||||||
self._pagesize = pagesize
|
self._pagesize = pagesize
|
||||||
|
|
||||||
|
def __len__(self):
|
||||||
|
# This is only useful for tests
|
||||||
|
return len(self.getslice())
|
||||||
|
|
||||||
def getslice(self, start=0, end=None):
|
def getslice(self, start=0, end=None):
|
||||||
res = []
|
res = []
|
||||||
for pagenum in itertools.count(start // self._pagesize):
|
for pagenum in itertools.count(start // self._pagesize):
|
||||||
|
|
Loading…
Reference in a new issue