Hi all:

I notice that if concatenating two stringobjects, PVM will not check the
dictionary of interned string. For example:

>>> a = "qwerty"
>>> b = "qwe"
>>> c = "rty"
>>> d = b+c
>>> id(a)
4572089736
>>> id(d)
4572111176
>>> e = "".join(["qwe","rty"])
>>> id(e)
4546460280

But if concatenating two string directly, PVM would check the dictionary:

>>> a = "qwerty"
>>> b = "qwe"+"rty"
>>> id(a)
4546460112
>>> id(b)
4546460112

It happens in Py2 and Py3 both.
Is it necessary for fixing this bug or not?


Cheers!
---
Yinbin
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to