[Python-ideas] string codes & substring equality
Terry Reedy
tjreedy at udel.edu
Fri Nov 29 02:57:57 CET 2013
On 11/28/2013 5:59 PM, Chris Angelico wrote:
> On Fri, Nov 29, 2013 at 9:56 AM, Greg Ewing <greg.ewing at canterbury.ac.nz> 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.
>
> Would you really keep a cache of 1114112 string objects around? Seems
> a bit of overkill.
I believe py2 *does* have a cache of 256 single byte strings. There
*might* be such a cache of the same size for the first 256 unicode
single char strings.
--
Terry Jan Reedy
More information about the Python-ideas
mailing list