[issue20294] Argument Clinic: add support for __init__

Larry Hastings report at bugs.python.org
Sun Jan 19 05:40:03 CET 2014


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 PyObject *.
* __init__ and __new__ should support all argument parsing
  scenarios (unpack tuple, positional only, etc).

Pre-exiting behavior:
* The C function basename chosen for __new__ is just the name of
  the class, it doesn't end in __new__.
* The methoddef #define is suppressed.

----------
Added file: http://bugs.python.org/file33537/larry.argument.clinic.init.and.new.patch.1.txt

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20294>
_______________________________________


More information about the Python-bugs-list mailing list