Message289558
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? |
|
Date |
User |
Action |
Args |
2017-03-14 01:53:20 | MSeifert | set | recipients:
+ MSeifert, lukasz.langa, serhiy.storchaka, josh.r |
2017-03-14 01:53:20 | MSeifert | set | messageid: <1489456400.61.0.0190935758708.issue29800@psf.upfronthosting.co.za> |
2017-03-14 01:53:20 | MSeifert | link | issue29800 messages |
2017-03-14 01:53:19 | MSeifert | create | |
|