I ran into last night and I still don't understand how to explain this:
class Foo(object): @property def dave(self): vars(self)['dave'] = 1 return 2 f = Foo() print f.dave print f.dave
Running this code calls:
2 2
The question is why? My understanding of access to attributes is that the instance dictionary is checked before the class dictionary, and the dictionary of any databases, however, as seen above, the instance dictionary is not displayed before the descriptor is in the class dictionary.
dmw
source share