This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Dominik Schmid, eryksun
Date 2015-12-04.11:51:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:57eryksunsetrecipients: + eryksun, Dominik Schmid
2015-12-04 11:51:56eryksunsetmessageid: <>
2015-12-04 11:51:56eryksunlinkissue25794 messages
2015-12-04 11:51:56eryksuncreate