[New-bugs-announce] [issue20390] Argument Clinic rollup patch, 2014/01/25
Larry Hastings
report at bugs.python.org
Sat Jan 25 16:28:46 CET 2014
New submission from Larry Hastings:
Rollup patch with a bunch of small fixes in it. Can I get a quick turnaround review on this? I'd like it to go in before today's beta is cut. Definitely the core change has to go in, but that's uncontroversial.
Core:
* _PyType_GetDocFromInternalDoc() and
_PyType_GetTextSignatureFromInternalDoc() are now marked
Py_LIMITED_API.
Tools:
* The default filename for the "file" preset is now:
"clinic/{filename}.h".
* The "class" directive syntax has been extended with two new required
arguments: "typedef" and "type_object". "typedef" should be the
equivalent C type for this Python class, presented as a
pointer-to-type. "type_object" should be an expression that
evaluates to a PyTypeObject * for this Python type. Example:
class dict "PyDictObject *" "&PyDict_Type"
This was necessary for the next item.
* If __new__ or __init__ functions did not use kwargs (or args), the
PyArg_NoKeywords (or PyArg_NoPositional) calls generated are only
run if the type object is an exact match. (Otherwise subclasses
will not be allowed to start accepting those kinds of arguments.)
* Argument Clinic now fails if you have required parameters after
optional parameters.
* Converters now have a new template they can inject code into:
it's called "modifiers", and code put there is run in the parsing
function after argument parsing but before the call to the impl.
"modifiers" is intended for converters that may want dynamic
default values. An example string you might add:
"if ({name} == NULL)\n name = time(NULL);"
----------
assignee: larry
components: Demos and Tools
files: larry.clinic.rollup.jan.25.diff.1.txt
messages: 209205
nosy: larry, ncoghlan, serhiy.storchaka, zach.ware
priority: normal
severity: normal
stage: patch review
status: open
title: Argument Clinic rollup patch, 2014/01/25
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file33702/larry.clinic.rollup.jan.25.diff.1.txt
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20390>
_______________________________________
More information about the New-bugs-announce
mailing list