2013/6/6 Maciej Fijalkowski <[email protected]>

> it *also* depends where the string comes from. I think encodings don't
> respect caching small strings for example


It's really a detail of the C implementation:
PyString_FromString() returns a prebuilt value when the length is 0 or 1,
but _PyString_Resize() won't replace the string being built with a shared
object.
Moreover those details completely changed with Python 3.3 and the new
Unicode implementation.

Don't use "is" with immutable objects (except with the singletons: None,
True, False)

-- 
Amaury Forgeot d'Arc
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to