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 serhiy.storchaka
Recipients Oren Milman, serhiy.storchaka
Date 2017-09-24.09:49:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506246578.92.0.83857994271.issue31311@psf.upfronthosting.co.za>
In-reply-to
Content
I thought about this issue so long because I can't find good cause for __dict__ to be not a dict. Defining the __dict__ method or property doesn't affect instance dictionary and attributes lookup. It just breaks the __setstate__ method. Without having good example of overriding __dict__ I have no good test cases and don't know what a way of handling this error is better.

There is yet one disadvantage of the current implementation. The instance's dict can be lazy. It can be created only on demand, when instance's attribute is set or the __dict__ attribute is read. PyObject_GetAttrString(myself, "__dict__") creates it if it was not created. It would be more efficient to use _PyObject_GetDictPtr(). But this is a separate issue, 3.7 only.
History
Date User Action Args
2017-09-24 09:49:38serhiy.storchakasetrecipients: + serhiy.storchaka, Oren Milman
2017-09-24 09:49:38serhiy.storchakasetmessageid: <1506246578.92.0.83857994271.issue31311@psf.upfronthosting.co.za>
2017-09-24 09:49:38serhiy.storchakalinkissue31311 messages
2017-09-24 09:49:38serhiy.storchakacreate