[Python-3000] Weird error message from bytes type

Guido van Rossum guido at python.org
Mon Feb 26 06:38:26 CET 2007


Please give the poor function a break. It was added to 2.5 and used
only for indexing there. In 3.0 it is more generally useful (I want to
use it whenever an int is needed). but in our pre-alpha code the error
messages haven't been fixed yet. That's the whole story.

On 2/25/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> 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.
>
> --
> Greg
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list