EDIT: yep, confirmed, the duplicates appear exactly as I had thought they would -- I've added a set
of id
s and return prepamaturelyprematurely after seeing a duplicate, and the number of total results reported for each and every month is exactly the page size -- confirming that each question is being yield
ed again right after all items on the first page have been yield
ed, exactly as the code I show above appears to say they would be.
So, any suggested workaround so I can examine all Qs meeting the constraints, and, only once each?-)
EDIT AGAIN: so I partly fixed def next():
in the result-set class (there's still a bug I can't yet fathom -- shows duplicates with a page size of 37 -- but at least it seems to work with a page size of 100, with no duplicates nor truncation to a multiple of 100). To make python3 setup.py install
work I also had to change setup.py since (at the github master) it was missing some modules (?).
The resulting branch is at https://github.com/aleaxit/Py-StackExchange/tree/betteriter and of course I've also sent a pull request for it. But the gist is to change the above-quoted brokenness into
def next(self):
current = self
while True:
for obj in current.items:
yield obj
if not current.has_more:
return
(no further changes below this).