summaryrefslogtreecommitdiff
path: root/Tools/clinic
Commit message (Collapse)AuthorAgeFilesLines
* gh-104050: Add type hints to Argument Clinic converter keywords (#104588)Erlend E. Aasland2023-05-171-12/+36
| | | | | Introduce TypeSet, and use it to annotate the 'accept' keyword of various C converters. Also add some missing return annotations for converter init functions.
* gh-104050: Add typing to Argument Clinic converters (#104547)Erlend E. Aasland2023-05-161-53/+57
|
* gh-104050: Add more annotations to `Tools/clinic.py` (#104544)Nikita Sobolev2023-05-163-30/+60
|
* gh-104050: Don't star-import 'types' in Argument Clinic (#104543)Erlend E. Aasland2023-05-161-3/+2
|
* gh-104050: Add basic typing to CConverter in clinic.py (#104538)Erlend E. Aasland2023-05-161-14/+14
|
* gh-64595: Fix write file logic in Argument Clinic (#104507)Erlend E. Aasland2023-05-161-11/+12
| | | | Check if any clinic output actually changes any of the output files before deciding if we should touch the source file.
* Bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic (#104501)dependabot[bot]2023-05-151-1/+1
| | | | | | | | | | | | | | | | build(deps-dev): bump mypy from 1.2.0 to 1.3.0 in /Tools/clinic Bumps [mypy](https://github.com/python/mypy) from 1.2.0 to 1.3.0. - [Commits](https://github.com/python/mypy/compare/v1.2.0...v1.3.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* gh-104050: Run mypy on `clinic.py` in CI (#104421)Alex Waygood2023-05-154-24/+55
| | | | | | | | | | * Add basic mypy workflow to CI * Make the type check pass --------- Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-104389: Add 'unused' keyword to Argument Clinic C converters (#104390)Erlend E. Aasland2023-05-121-1/+19
| | | | | | | | | Use the unused keyword param in the converter to explicitly mark an argument as unused: /*[clinic input] SomeBaseClass.stubmethod flag: bool(unused=True) [clinic start generated code]*/
* gh-90953: Don't use deprecated AST nodes in clinic.py (#104322)Alex Waygood2023-05-091-9/+3
|
* gh-64660: Don't hardcode Argument Clinic return converter result variable ↵Erlend E. Aasland2023-05-071-9/+14
| | | | name (#104200)
* gh-104146: Remove unused var 'parser_body_declarations' from clinic.py (#104214)Erlend E. Aasland2023-05-051-3/+1
|
* gh-64595: Argument Clinic: Touch source file if any output file changed ↵Erlend E. Aasland2023-05-051-6/+13
| | | | (#104152)
* gh-68395: Avoid naming conflicts by mangling variable names in Argument ↵Erlend E. Aasland2023-05-051-1/+12
| | | | | Clinic (#104065) Add all internally used variable names to CLINIC_PREFIXED_ARGS.
* gh-104146: Remove unused 'second_pass_replacements' from clinic.py (#104147)Erlend E. Aasland2023-05-041-19/+2
| | | | The code that manipulated 'second_pass_replacements' was removed in 2015 with commit 0759f84 (gh-67688, bpo-23500).
* gh-101409: Improve generated clinic code for self type checks (#101411)Erlend E. Aasland2023-01-311-10/+12
|
* Fix copy-paste error in `Tools/clinic.py` (#100560)Nikita Sobolev2022-12-281-1/+1
|
* GH-100342: check for allocation failure in AC `*args` parsing (#100343)Kumar Aditya2022-12-281-0/+4
|
* Remove `NoneType` redefinition from `clinic.py` (#100551)Nikita Sobolev2022-12-271-2/+0
|
* gh-100176: remove incorrect version compatibility check from argument clinic ↵Shantanu2022-12-121-4/+0
| | | | (#100190)
* gh-64490: Fix bugs in argument clinic varargs processing (#32092)colorfulappl2022-11-241-5/+6
|
* gh-99240: Fix double-free bug in Argument Clinic str_converter generated ↵colorfulappl2022-11-241-2/+23
| | | | | | | | code (GH-99241) Fix double-free bug mentioned at https://github.com/python/cpython/issues/99240, by moving memory clean up out of "exit" label. Automerge-Triggered-By: GH:erlend-aasland
* gh-64490: Fix refcount error when arguments are packed to tuple in argument ↵colorfulappl2022-11-241-1/+1
| | | | clinic (#99233)
* gh-92886: [clinic.py] raise exception on invalid input instead of assertion ↵Irit Katriel2022-10-071-1/+2
| | | | | | | (GH-98051) Tests should pass with -O (assertions off). Automerge-Triggered-By: GH:iritkatriel
* gh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE ↵Serhiy Storchaka2022-10-031-0/+1
| | | | | | | converter (GH-97729) It affects function os.system() on Windows and Windows-specific modules winreg, _winapi, _overlapped, and _msi.
* gh-90928: Improve static initialization of keywords tuple in AC (#95907)Erlend E. Aasland2022-08-131-42/+47
|
* gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code ↵Eric Snow2022-08-111-19/+79
| | | | | | | | | | | | | | | | (gh-95860) We only statically initialize for core code and builtin modules. Extension modules still create the tuple at runtime. We'll solve that part of interpreter isolation separately. This change includes generated code. The non-generated changes are in: * Tools/clinic/clinic.py * Python/getargs.c * Include/cpython/modsupport.h * Makefile.pre.in (re-generate global strings after running clinic) * very minor tweaks to Modules/_codecsmodule.c and Python/Python-tokenize.c All other changes are generated code (clinic, global strings).
* gh-95007: Remove the NoneType return converter (GH-95019)Serhiy Storchaka2022-07-201-11/+0
| | | | | It has confusing semantic which does not provide any benefit (the only difference is that you should write "return Py_None" instead of "Py_RETURN_NONE"), it is not currently used, and it is broken.
* gh-94430: Allow params named `module` or `self` with custom C names in ↵Erlend Egeberg Aasland2022-07-071-2/+7
| | | | Argument Clinic (#94431)
* gh-94538: Fix Argument Clinic output to custom file (#94539)Erlend Egeberg Aasland2022-07-051-1/+1
|
* gh-84623: Remove unused imports (#94132)Victor Stinner2022-06-221-1/+0
|
* gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)Inada Naoki2022-05-121-10/+0
|
* gh-92256: Improve Argument Clinic parser error messages (#92268)Erlend Egeberg Aasland2022-05-101-3/+9
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-91320: Argument Clinic uses _PyCFunction_CAST() (#32210)Victor Stinner2022-05-031-2/+5
| | | | Replace "(PyCFunction)(void(*)(void))func" cast with _PyCFunction_CAST(func).
* gh-91583: AC: Fix regression for functions with defining_class (GH-91739)Serhiy Storchaka2022-04-301-17/+36
| | | | | Argument Clinic now generates the same efficient code as before adding the defining_class parameter.
* bpo-45459: C API uses type names rather than structure names (GH-31528)Victor Stinner2022-02-241-2/+1
| | | | Thanks to the new pytypedefs.h, it becomes to use type names like PyObject rather like structure names like "struct _object".
* Remove an outdated comment. (GH-30010)Serhiy Storchaka2021-12-091-2/+0
|
* bpo-43413: Fix handling keyword arguments in subclasses of some buitin ↵Serhiy Storchaka2021-09-121-2/+8
| | | | | | | | classes (GH-26456) * Constructors of subclasses of some buitin classes (e.g. tuple, list, frozenset) no longer accept arbitrary keyword arguments. * Subclass of set can now define a __new__() method with additional keyword parameters without overriding also __init__().
* bpo-45060: Get rid of few uses of the equality operators with None (GH-28087)Serhiy Storchaka2021-08-311-2/+2
|
* bpo-24234: Implement bytes.__bytes__ (GH-27901)Dong-hee Na2021-08-231-1/+0
|
* bpo-44978: allow Argument Clinic to handle __complex__ special methods ↵Mark Dickinson2021-08-221-1/+0
| | | | (GH-27886)
* bpo-20201: variadic arguments support for AC (GH-18609)Batuhan Taskaya2021-07-161-59/+155
| | | Implement support for `*args` in AC, and port `print()` to use it.
* Do not use Py_ssize_clean_t (GH-25940)Inada Naoki2021-05-081-2/+2
|
* AC: Update unsupported_special_methods (GH-24956)Dong-hee Na2021-03-251-3/+3
|
* bpo-42398: Fix "make regen-all" race condition (GH-23362)Victor Stinner2020-11-181-19/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a race condition in "make regen-all" when make -jN option is used to run jobs in parallel. The clinic.py script now only use atomic write to write files. Moveover, generated files are now left unchanged if the content does not change, to not change the file modification time. The "make regen-all" command runs "make clinic" and "make regen-importlib" targets: * "make regen-importlib" builds object files (ex: Modules/_weakref.o) from source files (ex: Modules/_weakref.c) and clinic files (ex: Modules/clinic/_weakref.c.h) * "make clinic" always rewrites all clinic files (ex: Modules/clinic/_weakref.c.h) Since there is no dependency between "clinic" and "regen-importlib" Makefile targets, these two targets can be run in parallel. Moreover, half of clinic.py file writes are not atomic and so there is a race condition when "make regen-all" runs jobs in parallel using make -jN option (which can be passed in MAKEFLAGS environment variable). Fix clinic.py to make all file writes atomic: * Add write_file() function to ensure that all file writes are atomic: write into a temporary file and then use os.replace(). * Moreover, write_file() doesn't recreate or modify the file if the content does not change to avoid modifying the file modification file. * Update test_clinic to verify these assertions with a functional test. * Remove Clinic.force attribute which was no longer used, whereas Clinic.verify remains useful.
* bpo-41985: Add _PyLong_FileDescriptor_Converter and AC converter for ↵Serhiy Storchaka2020-10-091-0/+13
| | | | "fildes". (GH-22620)
* bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)Victor Stinner2020-08-111-4/+4
| | | Automerge-Triggered-By: @tiran
* bpo-36346: Undeprecate private function _PyUnicode_AsUnicode(). (GH-21336)Serhiy Storchaka2020-07-051-6/+0
|
* bpo-36346: Prepare for removing the legacy Unicode C API (AC only). (GH-21223)Serhiy Storchaka2020-06-301-2/+63
|
* bpo-40792: Make the result of PyNumber_Index() always having exact type int. ↵Serhiy Storchaka2020-05-281-1/+1
| | | | | | | | | | | | (GH-20443) Previously, the result could have been an instance of a subclass of int. Also revert bpo-26202 and make attributes start, stop and step of the range object having exact type int. Add private function _PyNumber_Index() which preserves the old behavior of PyNumber_Index() for performance to use it in the conversion functions like PyLong_AsLong().