You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 12, 2021. It is now read-only.
Node class docstring says:
"...accessing non-existent attributes will still return a Graph... You’ll have to check for the presence of a key first, to make sure what you're trying to access actually exists"
def user_location(user_id):
user = graph[user_id]()
if 'location' in user:
return user.location
return False
but in my tests if 'anything' in a_node always returns True.
I thought maybe I could do 'anything' in a_node.as_dict() ...but this throws Http 400 error from Facebook, I guess the unbunchify call unintentionally causes a load of weird API lookups via the getitem machinery of Graph/Node classes.
This works:
if 'location' in user.keys():
myvar = user.location
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Node class docstring says:
"...accessing non-existent attributes will still return a
Graph
... You’ll have to check for the presence of a key first, to make sure what you're trying to access actually exists"but in my tests if 'anything' in a_node always returns True.
I thought maybe I could do 'anything' in a_node.as_dict() ...but this throws Http 400 error from Facebook, I guess the unbunchify call unintentionally causes a load of weird API lookups via the getitem machinery of Graph/Node classes.
This works:
The text was updated successfully, but these errors were encountered: