On Fri, 18 Feb 2005 15:40:54 -0700, Travis Oliphant <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
> 
> >>Would it be possible to change
> >>
> >>_PyEval_SliceIndex  in ceval.c
> >>
> >>so that rather than throwing an error if the indexing object is not an
> >>integer, the code first checks to see if the object has a
> >>tp_as_number->nb_int method and calls it instead.
> >>
> >>
> >
> >I don't think this is the right solution; since float has that method,
> >it would allow floats to be used as slice indices,
> >
> >
> O.K.,
> 
> then how about if arrayobjects can make it in the core, then a check for
> a rank-0 integer-type
> arrayobject is allowed before raising an exception?

Following up on Bob's point, maybe making rank-0 integer type
arrayobjects inherit from int has some mileage?  Somewhat weird,
but...
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to