New submission from Larry Hastings:
As per Georg's request (and hacks in other places), Argument Clinic should have
support for special methods. To wit:
__init__ should be required to be an instance method. Clinic should suppress
its methoddef #define.
__new__ should be required to be a class method. Its C function name should
have the __new__ stripped off, and by convention its first argument should be
"PyTypeObject *type". Clinic should suppress its methoddef #define.
All other dunder-methods which have special slots in the PyTypeObject structure
should be rejected by Argument Clinic. (Their arguments are pre-parsed, and
they don't have docstrings... what would Clinic do for them?) Obviously
generic dunder-methods ("__getstate__", "__sizeof__") are still fine.
----------
assignee: larry
components: Demos and Tools
files: larry.special.methods.support.patch.1.txt
messages: 207980
nosy: georg.brandl, larry
priority: normal
severity: normal
stage: patch review
status: open
title: Argument Clinic should understand Python special methods
type: behavior
versions: Python 3.4
Added file:
http://bugs.python.org/file33433/larry.special.methods.support.patch.1.txt
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20228>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com