Message255859
Normally Python code calls built-in setattr, which calls the C API PyObject_SetAttr. This API interns the attribute name before calling the type's tp_setattro or tp_setattr function. Interning the string is a critical step, since the implementation for updating slots assumes the name is interned.
The __setattr__ slot wrapper calls wrap_setattr in Objects/typeobject.c. In line with how PyObject_SetAttr works, the attached patch interns the name in wrap_setattr before calling the wrapped setattrofunc. For good measure it also applies the same change to wrap_delattr, though that's not strictly necessary. |
|
Date |
User |
Action |
Args |
2015-12-04 11:51:57 | eryksun | set | recipients:
+ eryksun, Dominik Schmid |
2015-12-04 11:51:56 | eryksun | set | messageid: <1449229916.98.0.926575291001.issue25794@psf.upfronthosting.co.za> |
2015-12-04 11:51:56 | eryksun | link | issue25794 messages |
2015-12-04 11:51:56 | eryksun | create | |
|