[Python-ideas] string codes & substring equality

spir denis.spir at gmail.com
Sat Nov 30 23:20:25 CET 2013


On 11/30/2013 11:13 PM, Greg Ewing wrote:
> spir wrote:
>> Which strings, if any, are interned in Python (I'd bet, for lookup speed,
>> __dict__ key, meaning id's, meaning var & attr names)?
>
> Yes, identifiers are interned, and also short string
> literals that resemble identifiers (since they might
> get used in getattr calls and the like).
>
> But as far as I know, it's never done for strings
> constructed at run time unless you explicitly ask
> for it. So it wouldn't help for what we've been
> talking about.

Thank you ,Greg!

Denis



More information about the Python-ideas mailing list