[Python-3000] string C API

"Martin v. Löwis" martin at v.loewis.de
Wed Sep 13 06:38:30 CEST 2006


Fredrik Lundh schrieb:
> just noticed that PEP 3100 says that PyString_AsEncodedString and
> PyString_AsDecodedString is to be removed, but it doesn't mention
> any other PyString (or PyUnicode) functions.
> 
> how large changes can we make here, really ?

All API that refers to the internal representation should be
changed or removed; in theory, that could be all API that has
char* arguments.

For example, PyString_From{String[AndSize]|Format} would either:
- have to grow an encoding argument
- assume a default encoding (either ASCII or UTF-8)
- change its signature to operate on Py_UNICODE* (although
  we don't have literals for these) or
- be removed

Likewise, PyString_AsString either goes away or changes its
return type.

String APIs that operate on PyObject* likely can stay as-is.

Regards,
Martin


More information about the Python-3000 mailing list