[Python-3000] string C API

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Sep 16 03:07:06 CEST 2006

Josiah Carlson wrote:
> Because all text objects are internally
> represented in its minimal 'encoding', equal text objects will always be
> in the same encoding.

That places a burden on all creators of strings to ensure
that they are in the minimal format, which could be
inconvenient for some operations, e.g. taking a substring
could require making an extra pass to re-code the data.
It would also preclude the possibility of representing
a substring as a view.

I don't see any great advantage given by this restriction
anyway. So you could tell two strings were unequal in
some cases if they happened to have different storage
formats, but there would still be plenty of cases
where you did have to compare them. Doesn't look like
a big deal to me.


More information about the Python-3000 mailing list