Author eryksun
Recipients Dominik Schmid, eryksun
Date 2015-12-04.11:51:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449229916.98.0.926575291001.issue25794@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-12-04 11:51:57eryksunsetrecipients: + eryksun, Dominik Schmid
2015-12-04 11:51:56eryksunsetmessageid: <1449229916.98.0.926575291001.issue25794@psf.upfronthosting.co.za>
2015-12-04 11:51:56eryksunlinkissue25794 messages
2015-12-04 11:51:56eryksuncreate