Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor().limit(n) gives 'Cursor' object has no attribute 'limit' #28

Closed
sgornick opened this issue Apr 5, 2010 · 1 comment
Closed
Labels
Documentation This is regarding the library's documentation

Comments

@sgornick
Copy link

sgornick commented Apr 5, 2010

The documentation for the Cursor tutorial:
http://joshthecoder.github.com/tweepy/docs/cursor_tutorial.html#limits
shows:

# Only iterate through the first 200 statuses
for status in Cursor(api.user_timeline).limit(200):
    process_status(status)

however, that throws an exception:
AttributeError: 'Cursor' object has no attribute 'limit'

>>> import tweepy
>>> api = tweepy.API()
>>> statuses = tweepy.Cursor(api.user_timeline).limit(200);
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'Cursor' object has no attribute 'limit'

Without limit, works fine:

>>> statuses = tweepy.Cursor(api.user_timeline, screen_name='ev')
>>> status = statuses.items().next()
>>> status.text
'@xuanthu Saw Super Diamond...where?'
@joshthecoder
Copy link
Member

Sorry that was an error in the tutorial. The actual method would be items(200), not limit(200).

Fixed tutorial in commit d07ecd6

@Harmon758 Harmon758 added the Documentation This is regarding the library's documentation label May 3, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation This is regarding the library's documentation
Projects
None yet
Development

No branches or pull requests

3 participants