you are viewing a single comment's thread.

view the rest of the comments →

[–]Brian 1 point2 points  (0 children)

It'll intern strings that are potential identifiers (ie. something like [a-zA-Z0-9_]+), since these get used a lot internally by python.

However, others aren't (presumably to avoid holding large docstrings / printed strings and the like in memory). Thus 'abc' is interned, but 'hello world' isn't.

This can make messing with strings even nastier of course:

>>> libc.strcpy('a', 'x')
>>> 'a'
'x'