[issue20294] Argument Clinic: add support for __init__

2014-01-21 Thread Larry Hastings
Larry Hastings added the comment: That problem will be irrelevant, once builtin classes support signatures (#20189). -- ___ Python tracker ___ __

[issue20294] Argument Clinic: add support for __init__

2014-01-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Larry, now I can use Argument Clinic in the __init__ methods. But there is one problem. Docstring generated for the __init__ method contains the "__init__" name in the signature. Therefore it can't be used as class docstring. On other hand, the co

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Checked in. Thanks for bringing the problem to my attention, Serhiy, and thanks for the reviews you two! rmsr: If I had a stronger background in templating, maybe Argument Clinic would be cleaner inside. As it is I'm beating the problem to death with sheer f

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2e32462e4832 by Larry Hastings in branch 'default': Issue #20294: Argument Clinic now supports argument parsing for __new__ and http://hg.python.org/cpython/rev/2e32462e4832 -- nosy: +python-dev ___ Pytho

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Ryan Smith-Roberts
Ryan Smith-Roberts added the comment: I have reviewed this as best I am able. I'll be honest that a lot of clinic.py makes my eyes cross; I'm used to webdev templating, which is inverted from AC (flow control inside the template). Not complaining, it's a complicated subject. I do like the cent

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Zachary Ware
Zachary Ware added the comment: Output looks good and I didn't see anything that scared me in the patch, though I can't pretend to fully understand 100% of it. Builds on Windows, pickle tests pass, and nothing else is affected (that's checked in so far). Looks good to me, as far as I can see

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Whoops, that doesn't apply cleanly. Here's an updated patch. -- Added file: http://bugs.python.org/file33542/larry.argument.clinic.init.and.new.patch.2.txt ___ Python tracker ___

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Zachary Ware
Zachary Ware added the comment: Rietveld doesn't like the patch and I'm having a hard time finding a changeset on which I can get it to apply cleanly. May I suggest avoiding `--git` on `hg diff` unless copying/moving/renaming a file? -- nosy: +zach.ware __

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Here's a patch. Wasn't as easy as I thought, it kind of took all day. Changes include: * __init__ and __new__ always take kwargs. * if the function signature doesn't accept keyword arguments, it calls _PyArg_NoKeywords(). * __init__ returns int, not PyOb

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Oops, sorry, that last comment was intended for a different issue. Please ignore, and sorry for the spam! -- ___ Python tracker ___ __

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: > * As is probably expected, __init__ and __call__ procs > can't be converted. I should have a fix in for __init__ and __call__ later today. (Issue #20294.) For the record, you could convert them, you just had to wrap the parsing function to deal with the ret

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Larry Hastings
Larry Hastings added the comment: Oh! I thought it worked fine, because I've seen people convert both an __init__ and a __new__. But I guess they wrapped them. It's an easy change, I can try to do that today. -- assignee: -> larry ___ Python trac

[issue20294] Argument Clinic: add support for __init__

2014-01-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Currently Argument Clinic doesn't support the __init__ methods, mainly because the C implementation of this method should return int, not PyObject *. In some cases it is possible to wrap a function generated by Argument Clinic (as in Modules/_pickle.c). Bu