while loop instead of recursive call in cursor() #283

Closed
opened 2013-11-07 17:59:39 -08:00 by drevicko · 1 comment
drevicko commented 2013-11-07 17:59:39 -08:00 (Migrated from github.com)

The cursor() function currently loops through pages returned by twitter by recursively calling itself.

If, for example, I'm getting the follower list of a celebrity (say 5 million followers), it'll make 1000 api calls (twitter returns 5000 at a time), which will exceed pythons default recursion limit (990 on my setup).

It would be better to implement this as a while loop.

The `cursor()` function currently loops through pages returned by twitter by recursively calling itself. If, for example, I'm getting the follower list of a celebrity (say 5 million followers), it'll make 1000 api calls (twitter returns 5000 at a time), which will exceed pythons default recursion limit (990 on my setup). It would be better to implement this as a while loop.
drevicko commented 2013-11-24 16:18:47 -08:00 (Migrated from github.com)

Pull request #284 addresses this - closing.

Pull request #284 addresses this - closing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#283
No description provided.