Re: [Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

2005-02-18 Thread Guido van Rossum
[Travis] > > 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? Sure, *if* you can get the premise accepted. [David] > Following up on Bob's point, maybe making rank-0 integer type > arrayobjec

Re: [Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

2005-02-18 Thread David Ascher
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 t

Re: [Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

2005-02-18 Thread Travis Oliphant
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 rig

Re: [Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

2005-02-18 Thread Bob Ippolito
On Feb 18, 2005, at 4:36 PM, David Ascher wrote: On Fri, 18 Feb 2005 13:28:34 -0800, Guido van Rossum <[EMAIL PROTECTED]> 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 se

Re: [Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

2005-02-18 Thread Guido van Rossum
[Travis] > > > 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. [Guido

Re: [Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

2005-02-18 Thread David Ascher
On Fri, 18 Feb 2005 13:28:34 -0800, Guido van Rossum <[EMAIL PROTECTED]> 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 > >

Re: [Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

2005-02-18 Thread Brett C.
Travis Oliphant wrote: Hello again, There is a great discussion going on the numpy list regarding a proposed PEP for multidimensional arrays that is in the works. During this discussion as resurfaced regarding slicing with objects that are not IntegerType objects but that have a tp_as_number->nb

Re: [Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

2005-02-18 Thread Guido van Rossum
> 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;

[Python-Dev] Fixing _PyEval_SliceIndex so that integer-like objects can be used

2005-02-18 Thread Travis Oliphant
Hello again, There is a great discussion going on the numpy list regarding a proposed PEP for multidimensional arrays that is in the works. During this discussion as resurfaced regarding slicing with objects that are not IntegerType objects but that have a tp_as_number->nb_int method to convert