Which Python language rule allows the descriptor to be found first? -
I was clashing the previous night and I'm still telling about the loss:
Square Foo (object): @ Property Def Dave (self): Wars (own) ['Dave'] = 1 Return 2F = Fu (print) f.dave print f.dave
Runs this code:
2 2
Why is the question? My understanding of attribute access is that the dictionary of the dictionary is checked before the class dictionary, and in the dictionary of any base, although the dictionary seen in the dictionary as a dictionary is not checked before being described in the class dictionary Used to be. My understanding of attribute access is that the example dictionary is checked before the class dictionary, and the dictionary of any basis
is the exception of the data descriptor:
For example, binding depends on the predecessor of the descriptor orientation, which specification is defined. Typically, the data descriptor defines both
__get_ ()
and__set __ ()
, whereas non-data descriptors only get__ ()
method Data descriptors always override the definition in a single dictionary, on the contrary, the non-data descriptor can be overridden with examples.
Comments
Post a Comment