summaryrefslogtreecommitdiffstats
path: root/Tools/clinic
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* bpo-37942: Improve argument clinic float converter (GH-15470)Raymond Hettinger2019-08-251-6/+18
|
* Add description to the command line help of the argument clinic (GH-8518)Tim Hoffmann2019-06-021-1/+8
|
* bpo-36127: Argument Clinic: inline parsing code for keyword parameters. ↵Serhiy Storchaka2019-03-141-49/+147
| | | | (GH-12058)
* bpo-36048: Use __index__() instead of __int__() for implicit conversion if ↵Serhiy Storchaka2019-02-251-0/+2
| | | | | | available. (GH-11952) Deprecate using the __int__() method in implicit conversions of Python numbers to C integers.
* bpo-36101: remove non-ascii characters in docstring (GH-12018)animalize2019-02-241-0/+3
| | | | | * remove non-ascii characters in docstring * clinic.py emits a warning when docstring has non-ascii character
* bpo-35582: Argument Clinic: Optimize the "all boring objects" case. (GH-11520)Serhiy Storchaka2019-01-111-40/+0
| | | | | Use _PyArg_CheckPositional() and inlined code instead of PyArg_UnpackTuple() and _PyArg_UnpackStack() if all parameters are positional and use the "object" converter.
* bpo-35582: Argument Clinic: inline parsing code for positional parameters. ↵Serhiy Storchaka2019-01-111-86/+163
| | | | (GH-11313)
* bpo-23867: Argument Clinic: inline parsing code for a single positional ↵Serhiy Storchaka2018-12-251-16/+433
| | | | parameter. (GH-9689)
* bpo-20180: Simplify char_converter in Argument Clinic. (GH-9828)Serhiy Storchaka2018-12-251-18/+3
| | | Fix also handling non-ascii default values.
* bpo-35490: Remove the DecodeFSDefault return converter in AC. (#11152)Serhiy Storchaka2018-12-171-10/+0
|
* bpo-35489: Use "const Py_UNICODE *" for the Py_UNICODE converter in AC. ↵Serhiy Storchaka2018-12-141-1/+1
| | | | (GH-11150)
* bpo-33012: Fix invalid function cast warnings with gcc 8 in Argument Clinic. ↵Serhiy Storchaka2018-11-271-1/+7
| | | | | | | | (GH-6748) Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS in Argument Clinic generated code.
* bpo-32892: Use ast.Constant instead of specific constant AST types. (GH-9445)Serhiy Storchaka2018-09-271-5/+12
|
* Remove wording that could be deemed to be perjorative (GH-9287)Raymond Hettinger2018-09-141-1/+1
|
* bpo-26901: Fix the Argument Clinic test suite (GH-8879)Victor Stinner2018-09-031-791/+0
| | | | | | | | | | * Fix Tools/clinic/clinic_test.py: add missing FakeClinic.destination_buffers attribute and pass a file argument to Clinic(). * Rename Tools/clinic/clinic_test.py to Lib/test/test_clinic.py: add temporary Tools/clinic/ to sys.path to import the clinic module. Co-Authored-By: Pablo Galindo <pablogsal@gmail.com>
* bpo-20260: Implement non-bitwise unsigned int converters for Argument ↵Serhiy Storchaka2018-07-261-13/+21
| | | | Clinic. (GH-8434)
* bpo-20180: complete AC conversion of Objects/stringlib/transmogrify.h (GH-8039)Tal Einat2018-07-061-2/+22
| | | | * converted bytes methods: expandtabs, ljust, rjust, center, zfill * updated char_convertor to properly set the C default value
* bpo-32240: Add the const qualifier to declarations of PyObject* array ↵Serhiy Storchaka2017-12-151-2/+2
| | | | arguments. (#4746)
* bpo-31926: fix missing *_METHODDEF statements by argument clinic (#4230)Tal Einat2017-11-031-2/+2
| | | | | | | | | When a single .c file contains several functions and/or methods with the same name, a safety _METHODDEF #define statement is generated only for one of them. This fixes the bug by using the full name of the function to avoid duplicates rather than just the name.
* bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)Serhiy Storchaka2017-07-031-10/+7
| | | | | the bare METH_FASTCALL be used for functions with positional-only parameters.
* bpo-30600: Fix error messages (condition order in Argument Clinic) (#2051)Sylvain2017-06-101-7/+7
| | | | | | | | The function '_PyArg_ParseStack()' and '_PyArg_UnpackStack' were failing (with error "XXX() takes Y argument (Z given)") before the function '_PyArg_NoStackKeywords()' was called. Thus, the latter did not raise its more meaningful error : "XXX() takes no keyword arguments".
* bpo-30492: Allow make clinic to work out of tree. (#1836)Gregory P. Smith2017-05-271-2/+10
| | | | | | * bpo-30492: Allow make clinic to work out of tree. * Use os.curdir instead of "." as the default value.
* bpo-29935: Fixed error messages in the index() method of tuple, list and ↵Serhiy Storchaka2017-03-301-2/+2
| | | | | deque (#887) when pass indices of wrong type.
* bpo-29852: Argument Clinic Py_ssize_t converter now supports None (#716)Serhiy Storchaka2017-03-301-2/+10
| | | if pass `accept={int, NoneType}`.
* bpo-29919: Remove unused imports found by pyflakes (#137)Victor Stinner2017-03-271-2/+0
| | | Make also minor PEP8 coding style fixes on modified imports.
* bpo-29748: Added the slice index converter in Argument Clinic. (#549)Serhiy Storchaka2017-03-191-0/+12
|