summaryrefslogtreecommitdiffstats
path: root/Tools/clinic
Commit message (Collapse)AuthorAgeFilesLines
* 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().
* bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)Serhiy Storchaka2020-05-261-52/+2
| | | | Only __index__ should be used to make integer conversions lossless.
* bpo-38787: Fix Argument Clinic defining_class_converter (GH-20074)Victor Stinner2020-05-131-2/+7
| | | | | | | Don't hardcode defining_class parameter name to "cls": * Define CConverter.set_template_dict(): do nothing by default * CLanguage.render_function() now calls set_template_dict() on all converters.
* bpo-38787: C API for module state access from extension methods (PEP 573) ↵Petr Viktorin2020-05-071-6/+58
| | | | | | | | | (GH-19936) Module C state is now accessible from C-defined heap type methods (PEP 573). Patch by Marcel Plch and Petr Viktorin. Co-authored-by: Marcel Plch <mplch@redhat.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364)Serhiy Storchaka2020-04-181-21/+16
| | | | Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* bpo-39573: Update clinic to use Py_IS_TYPE() function (GH-18507)Dong-hee Na2020-02-141-9/+6
|
* argument-clinic: Simplify multi-line string handling (GH-17852)Dong-hee Na2020-01-061-2/+2
|
* bpo-27961: Replace PY_LONG_LONG with long long. (GH-15386)Sergey Fedoseev2019-10-211-1/+1
|
* bpo-37206: Unrepresentable default values no longer represented as None. ↵Serhiy Storchaka2019-09-141-7/+6
| | | | | | | (GH-13933) In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all.
* bpo-37034: Display argument name on errors with keyword arguments with ↵Rémi Lapeyre2019-08-291-80/+101
| | | | Argument Clinic. (GH-13593)