Reputation: 1096
I am really curious as to how Python's interpreter makes an attribute x
out of a method x
through x=property(x)
. If I could take a look at the C
code, I would feel much better.
Upvotes: 5
Views: 1291
Reputation: 1123400
The type is defined in the descrobject.c
file.
You can locate Python types like these by first looking for the function name in bltinmodule.c
; in this case the following line defines the property()
function:
SETBUILTIN("property", &PyProperty_Type);
then grep for the PyProperty_Type
definition in the Objects
subdirectory.
Upvotes: 10