[Python-Dev] Documenting the ssize_t Python C API changes

"Martin v. Löwis" martin at v.loewis.de
Tue Mar 21 16:22:21 CET 2006

M.-A. Lemburg wrote:
> Interesting: A few mails ago you suggested that developers
> do exactly what I did to get the list of changes. Now you
> gripe about the output format of the grep.

Developers which use grep can read the output of grep. Developers
which use other methods of searching (e.g. Visual Studio) can
understand the output of these tools. I don't say they *should*
search for Py_ssize_t, I said they *can* if they want to.

I still don't think anybody would *want* to read such a list.

> I really don't understand what your problem is with documenting
> the work that you and others have put into this. Why is there
> so much resistance ?

Because I think it is pointless, confusing, and redundant in a dangerous
way. There is absolutely NO problem with API changes where a function
consumes Py_ssize_t. Why should anybody care that 
PyString_FromStringAndSize now consumes a Py_ssize_t? Passing an int
works just fine, and if the int fits the length of the string, it will
absolutely do the right thing. There is no need to touch that code,
or worry about the change.

Putting PyString_FromStringAndSize into such a list *will* make
developers worry, because they now think they have to change their code
somehow, when there is absolutely for action.

Furthermore, it is redundant because there are now *four* places where
the signature of the API is mentioned: in the header, in the
implementation, in the API docs, and in the PEP. The compiler watches
for consistency of the first two; consistency of the others is a manual
process, and thus error-prone.


More information about the Python-Dev mailing list