Michael Seifert added the comment:

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?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29800>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to