[issue27458] Allow subtypes of unicode/str to hit the optimized unicode_concatenate block

Ammar Askar report at bugs.python.org
Tue Jul 5 23:17:07 EDT 2016


Ammar Askar added the comment:

Thank you very much for the prompt feedback.

I didn't even realize there was a __radd__ method, great catch. I've fixed this and added an appropriate test.

Very good point about the interning. Seeing as its an implementation detail, I've changed the interned tests to cpython only and added the assertion to ensure they are not interned. I don't think there's any language level features to ensure strings are not interned.

As far as testing the execution path goes. I was updating the source code in my test.py script between concatenating with subtypes vs just plain old unicode objects since doing multiple traces was starting to get a lot more complicated with gdb scripting :)

----------
Added file: http://bugs.python.org/file43635/python.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27458>
_______________________________________


More information about the Python-bugs-list mailing list