[Python-ideas] string codes & substring equality

spir denis.spir at gmail.com
Fri Nov 29 07:27:15 CET 2013


On 11/28/2013 11:56 PM, Greg Ewing wrote:
> spir wrote:
>> Is it weird to consider a .code(i) string method?
>
> Another approach would be to keep a cache of single-char
> strings, like we do for small integers.

Yes, this is an idea. If I did the decoding (usually from utf8) into a string of 
codes, instead of Python doing it to build its internal str repr, then I could 
easily in // record a list of single-char strings.
I'll keep this idea aside anyway, thank you, Greg.

Denis



More information about the Python-ideas mailing list