Message288414
| Author |
methane |
| Recipients |
mbussonn, methane, takluyver, vstinner |
| Date |
2017年02月23日.06:21:42 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1487830902.7.0.871818005132.issue29622@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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"); |
|
History
|
|---|
| 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 |
|