Re: [Python-Dev] More C API abstraction for user defined types

2010-07-17 Thread Petre Galan
Nick Coghlan gmail.com> writes: > >On Wed, Jul 14, 2010 at 11:50 PM, Petre Galan gmail.com wrote: >> No. The right interface is PyNumber_Long. The purpose of the PyNumber_Index >> (and nb_index slot) is as index in slicing. > > Allowing other objects to say "I&#

Re: [Python-Dev] More C API abstraction for user defined types

2010-07-14 Thread Petre Galan
Nick Coghlan gmail.com> writes: > > On Tue, Jul 13, 2010 at 6:44 PM, Mark Dickinson gmail.com> wrote: > > On Mon, Jul 12, 2010 at 10:19 PM, Nick Coghlan gmail.com> wrote: > >> On Tue, Jul 13, 2010 at 3:35 AM, Petre Galan gmail.com> wrote: > >

[Python-Dev] More C API abstraction for user defined types

2010-07-12 Thread Petre Galan
Hello, Defining a user type which implements number protocol should be treated as a number (long) in PyArg_ParseTuple using "l" format. In getargs.c: case 'l': {/* long int */ long *p = va_arg(*p_va, long *); long ival; if (float_argument_err