Re: [Python-Dev] Using argument clinic to replace timemodule.c:parse_time_t_args()

2014-01-21 Thread Serhiy Storchaka
21.01.14 04:44, Nikolaus Rath написав(ла): Serhiy Storchaka writes: 20.01.14 06:19, Nikolaus Rath написав(ла): This works if the user calls time.gmtime(None), but it fails for time.gmtime(). It seems that in that case my C converter function is never called. What's the trick that I'm missing?

Re: [Python-Dev] Using argument clinic to replace timemodule.c:parse_time_t_args()

2014-01-21 Thread Larry Hastings
On 01/21/2014 12:59 AM, Serhiy Storchaka wrote: 21.01.14 04:44, Nikolaus Rath написав(ла): Serhiy Storchaka writes: 20.01.14 06:19, Nikolaus Rath написав(ла): This works if the user calls time.gmtime(None), but it fails for time.gmtime(). It seems that in that case my C converter function is

Re: [Python-Dev] signature.object, argument clinic and grouped parameters

2014-01-21 Thread Nick Coghlan
On 21 Jan 2014 13:49, "Larry Hastings" wrote: > > On 01/20/2014 03:53 PM, Nick Coghlan wrote: >> >> Please turn the question around and look at it with your release manager hat on rather than your creator of Argument Clinic hat: if I came to you and said I wanted to add a new public API to the ins

[Python-Dev] Formatting of positional-only parameters in signatures

2014-01-21 Thread Yury Selivanov
There is one more, hopefully last, open urgent question with the signature  object. At the time we were working on the PEP 362, PEP 457 didn’t  exist. Nor did we have any function with real positonal-only parameters,  since there was no Argument Clinic yet. However, I implemented  rudimentary suppo

Re: [Python-Dev] PEP 461 updates

2014-01-21 Thread Chris Barker
On Sun, Jan 19, 2014 at 7:21 AM, Oscar Benjamin wrote: > > long as numpy.loadtxt is explicitly documented as only working with > > latin-1 encoded files (it currently isn't), there's no problem. > > Actually there is problem. If it explicitly specified the encoding as > latin-1 when opening the fi

Re: [Python-Dev] Formatting of positional-only parameters in signatures

2014-01-21 Thread Terry Reedy
On 1/21/2014 10:59 AM, Yury Selivanov wrote: There is one more, hopefully last, open urgent question with the signature object. At the time we were working on the PEP 362, PEP 457 didn’t exist. Nor did we have any function with real positonal-only parameters, since there was no Argument Clinic ye

Re: [Python-Dev] Formatting of positional-only parameters in signatures

2014-01-21 Thread Yury Selivanov
Terry, On January 21, 2014 at 12:23:31 PM, Terry Reedy (tjre...@udel.edu) wrote: > > On 1/21/2014 10:59 AM, Yury Selivanov wrote: > > There is one more, hopefully last, open urgent question with > the signature > > object. At the time we were working on the PEP 362, PEP 457 didn’t > > exist. N

Re: [Python-Dev] Formatting of positional-only parameters in signatures

2014-01-21 Thread Ethan Furman
On 01/21/2014 07:59 AM, Yury Selivanov wrote: 2. Adopt PEP 457 style: using “/“ to separate positional-only parameters from the rest. +1 -- ~Ethan~ ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] Formatting of positional-only parameters in signatures

2014-01-21 Thread Nick Coghlan
On 22 Jan 2014 03:24, "Terry Reedy" wrote: > > On 1/21/2014 10:59 AM, Yury Selivanov wrote: >> >> There is one more, hopefully last, open urgent question with the signature >> object. At the time we were working on the PEP 362, PEP 457 didn’t >> exist. Nor did we have any function with real posito

Re: [Python-Dev] Using argument clinic to replace timemodule.c:parse_time_t_args()

2014-01-21 Thread Nikolaus Rath
Larry Hastings writes: > A comment on your approach so far: I'm very much against giving > "default" a default value in the constructor. You mean in the definition of the custom converter class? > I realize that hack saves you having to say "= NULL" in a lot of > places. But explicit is better

Re: [Python-Dev] Using argument clinic to replace timemodule.c:parse_time_t_args()

2014-01-21 Thread Larry Hastings
Yes, I meant in the definition of the convertor class.  You can fix c_default in converter_init. On Jan 21, 2014 7:19 PM, Nikolaus Rath wrote: > > Larry Hastings writes: > > A comment on your approach so far: I'm very much against giving > > "default" a default value in the constructor. > > You

Re: [Python-Dev] Using argument clinic to replace timemodule.c:parse_time_t_args()

2014-01-21 Thread Nikolaus Rath
Larry Hastings writes: > All is not lost! What follows is rough pseudo-C code, hopefully you > can take it from here. > >typedef struct { > int set; > time_t when; >} clinic_time_t; > >#define DEFAULT_CLINIC_TIME_T {0, 0} > >static int >parse_clinic_time_t_arg(PyOb

Re: [Python-Dev] Using argument clinic to replace timemodule.c:parse_time_t_args()

2014-01-21 Thread Serhiy Storchaka
22.01.14 07:13, Nikolaus Rath написав(ла): To me this version looks shorter and clearer. Is there really an advantage in defining the clinic argument as a custom struct rather than object? To me too. ___ Python-Dev mailing list Python-Dev@python.org