We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
session = pynder.Session(FBTOKEN) users = session.nearby_users() for user in users[:5]: print user.like()
Will result in:
for user in users[:5]: TypeError: 'generator' object has no attribute '__getitem__'
Similarly, trying something like this:
users = session.nearby_users() # returns a list of users nearby user = users[0] user.bio # their biography
will result in the same error, since you can't reference a generator like that.
How do I get around this?
The text was updated successfully, but these errors were encountered:
Solve: a for loop will implicitly move through a generator if used like this:
users = session.nearby_users() # returns a list of users nearby for user in users: print(user.name)
Although how would one do something like users[n].like()?
users[n].like()
Sorry, something went wrong.
No branches or pull requests
Will result in:
Similarly, trying something like this:
will result in the same error, since you can't reference a generator like that.
How do I get around this?
The text was updated successfully, but these errors were encountered: