Why does hasattr execute the @property decorator code block
Why does hasattr execute the @property decorator code block Question: In Python when I call the hasattr on a @property decorator the hasattr function actually runs the @property code block. E.g. a class: class GooglePlusUser(object): def __init__(self, master): self.master = master def get_user_id(self): return self.master.google_plus_service.people().get(userId=’me’).execute()[‘id’] @property def profile(self): # this runs with hasattr return self.master.google_plus_service.people().get(userId=’me’).execute() …