GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-108494: Argument Clinic: fix support of Limited C API by serhiy-storchaka · Pull Request #108536 · python/cpython Conversation
|
|
Yet one issue: the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| def test_varargs1min(self): | ||
| msg = r"get expected at least 1 argument, got 0" | ||
| msg = (r"get\(\) takes at least 1 argument \(0 given\)|" |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
PyArg_ParseTuple() produces slightly different error message.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I'm very excited by this change! I will try to review it soon. Would it be possible to write unit tests in _testclinic_limited and test_clinic, for unusual cases like deprecated parameters and (if possible) defining class? In my other PR, I wrote tests for basic positional or keywords parameters. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
As for tests, I think that we should run all (or almost all) clinic tests in two modes. Instead of adding new tests for the limited API or duplicating test code we should generate and build different modules from the same source with different options. But this is a different PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| arg = PyLong_AsInt(arg_); | ||
| if (arg == -1 && PyErr_Occurred()) { | ||
| if (!PyArg_Parse(arg_, "i:my_int_func", &arg)) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It looks like regression, but actually not all inlined parsing code is compatible with the limited C API. In following PR I will implement inlining correctly, only for converters compatible with the limited C API. It will be large but mostly boring change (adding new parameter and simple checks in tens of functions), so I did not include it here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Erlend E. Aasland <[email protected]>
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I may have missed something, but this looks good to me. Thanks, Serhiy!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No complaints from me (though I'm not an expert on the limited C API)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.