string-interning

Python string interning

Python string interning Question: While this question doesn’t have any real use in practice, I am curious as to how Python does string interning. I have noticed the following. >>> “string” is “string” True This is as I expected. You can also do this. >>> “strin”+”g” is “string” True And that’s pretty clever! But you …

Total answers: 2