◐ Shell
clean mode source ↗

Message 208444 - Python tracker

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.