Message288414
AST type doesn't have any information about optional fields. And I don't know it's worth enough to add it.
When AST is instantiated by keyword arguments, there are no check about absence of some fields.
I suppose we can just loosen positional arguments too.
current:
if (PyTuple_GET_SIZE(args) > 0) {
if (numfields != PyTuple_GET_SIZE(args)) {
PyErr_Format(PyExc_TypeError, "%.400s constructor takes %s"
"%zd positional argument%s",
Py_TYPE(self)->tp_name,
numfields == 0 ? "" : "either 0 or ",
numfields, numfields == 1 ? "" : "s");
will be:
if (PyTuple_GET_SIZE(args) > 0) {
if (numfields > PyTuple_GET_SIZE(args)) {
PyErr_Format(PyExc_TypeError, "%.400s constructor takes at most "
"%zd positional argument%s",
Py_TYPE(self)->tp_name,
numfields, numfields == 1 ? "" : "s"); |
|
Date |
User |
Action |
Args |
2017-02-23 06:21:42 | methane | set | recipients:
+ methane, vstinner, takluyver, mbussonn |
2017-02-23 06:21:42 | methane | set | messageid: <1487830902.7.0.871818005132.issue29622@psf.upfronthosting.co.za> |
2017-02-23 06:21:42 | methane | link | issue29622 messages |
2017-02-23 06:21:42 | methane | create | |
|