[Python-3000] Weird error message from bytes type

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Feb 26 04:42:46 CET 2007

Guido van Rossum wrote:

> I find it important to use that API since anything that wants to
> behave like a (small) int should be acceptable.

But by calling __index__ and giving error messages about
indexes, PyInt_AsSsize_t seems to be assuming that the
value is going to be used as an index.

If that's the true purpose of PyInt_AsSsize_t, then it
shouldn't be getting called in this situation.

If it's not, then it shouldn't be giving error messages
that talk about indexes, and there should be another
API such as PyObject_AsIndex for values that really
are going to be used as indexes.


More information about the Python-3000 mailing list