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 MSeifert
Recipients MSeifert, josh.r, lukasz.langa, serhiy.storchaka
Date 2017-03-14.01:53:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1489456400.61.0.0190935758708.issue29800@psf.upfronthosting.co.za>
In-reply-to
Content
Given that this my first contribution to CPython I'm not too sure about the etiquette. When do I know (or who decides) when an agreement on a fix is reached? I wouldn't mind retracting the pull request if someone else wants to fix it differently.

I actually used the PyUnicode_Check on purpose because I always viewed the representation should be either unreadably (like objectxyz at 0xwhatever) or something that can should be copy&pasted-able. Returning something that will definetly throw an exception when copied seemed inappropriate.

But the %S change definetly has it's attraction: shorter, also fixes the segfault and no need for type checking.

Given Serhiy's answer it seems to me there could be another lurking problem because any %R or %S is potentially a problem within PyDict_Next - because this C-API-Function states that "The dictionary p should not be mutated during iteration. It is safe to modify the values of the keys as you iterate over the dictionary, but only so long as the set of keys does not change." But arbitary __str__ or __repr__ functions could do just that. I'm mostly an end-user so I'm not sure if I understand that right?
History
Date User Action Args
2017-03-14 01:53:20MSeifertsetrecipients: + MSeifert, lukasz.langa, serhiy.storchaka, josh.r
2017-03-14 01:53:20MSeifertsetmessageid: <1489456400.61.0.0190935758708.issue29800@psf.upfronthosting.co.za>
2017-03-14 01:53:20MSeifertlinkissue29800 messages
2017-03-14 01:53:19MSeifertcreate