summaryrefslogtreecommitdiffstats
path: root/Python/clinic/bltinmodule.c.h
Commit message (Collapse)AuthorAgeFilesLines
* gh-105879: Add support for keyword arguments to eval and exec (#105885)Raphael Gaschignard2024-05-021-24/+59
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-117764: Fix and add signatures for many builtins (GH-117769)Serhiy Storchaka2024-04-121-4/+4
|
* gh-76763: Make chr() always raising ValueError for out-of-range values ↵Serhiy Storchaka2024-02-101-20/+1
| | | | | | (GH-114882) Previously it raised OverflowError for very large or very small values.
* gh-111089: Revert PyUnicode_AsUTF8() changes (#111833)Victor Stinner2023-11-071-2/+7
| | | | | | | | | | | | | | | | | | | | | * Revert "gh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (#111585)" This reverts commit d9b606b3d04fc56fb0bcc479d7d6c14562edb5e2. * Revert "gh-111089: Use PyUnicode_AsUTF8() in getargs.c (#111620)" This reverts commit cde1071b2a72e8261ca66053ef61431b7f3a81fd. * Revert "gh-111089: PyUnicode_AsUTF8() now raises on embedded NUL (#111091)" This reverts commit d731579bfb9a497cfb0076cb6b221058a20088fe. * Revert "gh-111089: Add PyUnicode_AsUTF8() to the limited C API (#111121)" This reverts commit d8f32be5b6a736dc2fc9dca3f1bf176c82fc9b44. * Revert "gh-111089: Use PyUnicode_AsUTF8() in sqlite3 (#111122)" This reverts commit 37e4e20eaa8f27ada926d49e5971fecf0477ad26.
* gh-111089: Use PyUnicode_AsUTF8() in Argument Clinic (#111585)Victor Stinner2023-11-011-7/+2
| | | | | | | Replace PyUnicode_AsUTF8AndSize() with PyUnicode_AsUTF8() to remove the explicit check for embedded null characters. The change avoids to have to include explicitly <string.h> to get the strlen() function when using a recent version of the limited C API.
* gh-110964: Remove private _PyArg functions (#110966)Victor Stinner2023-10-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the following private functions and structures to pycore_modsupport.h internal C API: * _PyArg_BadArgument() * _PyArg_CheckPositional() * _PyArg_NoKeywords() * _PyArg_NoPositional() * _PyArg_ParseStack() * _PyArg_ParseStackAndKeywords() * _PyArg_Parser structure * _PyArg_UnpackKeywords() * _PyArg_UnpackKeywordsWithVararg() * _PyArg_UnpackStack() * _Py_ANY_VARARGS() Changes: * Python/getargs.h now includes pycore_modsupport.h to export functions. * clinic.py now adds pycore_modsupport.h when one of these functions is used. * Add pycore_modsupport.h includes when a C extension uses one of these functions. * Define Py_BUILD_CORE_MODULE in C extensions which now include directly or indirectly (via code generated by Argument Clinic) pycore_modsupport.h: * _csv * _curses_panel * _dbm * _gdbm * _multiprocessing.posixshmem * _sqlite.row * _statistics * grp * resource * syslog * _testcapi: bad_get() no longer uses METH_FASTCALL calling convention but METH_VARARGS. Replace _PyArg_UnpackStack() with PyArg_ParseTuple(). * _testcapi: add PYTESTCAPI_NEED_INTERNAL_API macro which is defined by _testcapi sub-modules which need the internal C API (pycore_modsupport.h): exceptions.c, float.c, vectorcall.c, watchers.c. * Remove Include/cpython/modsupport.h header file. Include/modsupport.h no longer includes the removed header file. * Fix mypy clinic.py
* gh-107603: Argument Clinic: Only include pycore_gc.h if needed (#108726)Victor Stinner2023-08-311-4/+3
| | | | | | | | | | | | | | | | | | | | Argument Clinic now only includes pycore_gc.h if PyGC_Head is needed, and only includes pycore_runtime.h if _Py_ID() is needed. * Add 'condition' optional argument to Clinic.add_include(). * deprecate_keyword_use() includes pycore_runtime.h when using the _PyID() function. * Fix rendering of includes: comments start at the column 35. * Mark PC/clinic/_wmimodule.cpp.h and "Objects/stringlib/clinic/*.h.h" header files as generated in .gitattributes. Effects: * 42 header files generated by AC no longer include the internal C API, instead of 4 header files before. For example, Modules/clinic/_abc.c.h no longer includes the internal C API. * Fix _testclinic_depr.c.h: it now always includes pycore_runtime.h to get _Py_ID().
* gh-108444: Argument Clinic uses PyLong_AsInt() (#108458)Victor Stinner2023-08-241-6/+6
| | | | Argument Clinic now uses the new public PyLong_AsInt(), rather than the old name _PyLong_AsInt().
* gh-107526: Revert "gh-100357: Convert several functions in bltinsmodule to ↵Nikita Sobolev2023-08-211-195/+1
| | | | AC" (#107542)
* gh-92536: Argument Clinic no longer emits PyUnicode_READY() (#105208)Victor Stinner2023-06-011-4/+1
| | | | | | Since Python 3.12, PyUnicode_READY() does nothing and always returns 0. Argument Clinic now also checks for .cpp files (PC/_wmimodule.cpp).
* gh-100776: Fix misleading default value in help(input) (#100788)Shantanu2023-01-081-2/+2
|
* gh-100357: Convert several functions in `bltinsmodule` to AC (#100358)Nikita Sobolev2022-12-241-1/+195
|
* bpo-15999: Accept arbitrary values for boolean parameters. (#15609)Serhiy Storchaka2022-12-031-3/+3
| | | builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
* gh-96526: Clarify format and __format__ docstrings (gh-96648)Michael2022-10-031-5/+8
|
* Fix typos in `bltinmodule.c`. (GH-97766)Nikita Sobolev2022-10-031-5/+5
|
* gh-90928: Improve static initialization of keywords tuple in AC (#95907)Erlend E. Aasland2022-08-131-120/+50
|
* gh-90928: Statically Initialize the Keywords Tuple in Clinic-Generated Code ↵Eric Snow2022-08-111-8/+245
| | | | | | | | | | | | | | | | (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-92203: Add closure support to exec(). (#92204)larryhastings2022-05-061-11/+26
| | | Add a closure keyword-only parameter to exec(). It can only be specified when exec-ing a code object that uses free variables. When specified, it must be a tuple, with exactly the number of cell variables referenced by the code object. closure has a default value of None, and it must be None if the code object doesn't refer to any free variables.
* gh-91320: Argument Clinic uses _PyCFunction_CAST() (#32210)Victor Stinner2022-05-031-18/+18
| | | | Replace "(PyCFunction)(void(*)(void))func" cast with _PyCFunction_CAST(func).
* Use FASTCALL for __import__ (GH-31752)Kumar Aditya2022-03-111-1/+80
|
* bpo-20201: variadic arguments support for AC (GH-18609)Batuhan Taskaya2021-07-161-1/+75
| | | Implement support for `*args` in AC, and port `print()` to use it.
* bpo-43918: document signature and default argument of `anext` builtin (#25551)Erik Welch2021-06-221-2/+5
| | | Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
* bpo-31861: Add aiter and anext to builtins (#23847)Joshua Bronson2021-03-231-1/+45
| | | | | | Co-authored-by: jab <jab@users.noreply.github.com> Co-authored-by: Daniel Pope <mauve@mauveweb.co.uk> Co-authored-by: Justin Wang <justin39@gmail.com>
* bpo-40471: Fix grammar typo in 'issubclass' docstring (GH-19847)Alex Povel2020-06-031-3/+3
| | | | | Just a brief grammar fix. See also <>.
* bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)Serhiy Storchaka2020-05-261-26/+1
| | | | Only __index__ should be used to make integer conversions lossless.
* Shorter docstring (GH-16322)Raymond Hettinger2019-09-211-2/+2
|
* bpo-38237: Make pow's arguments have more descriptive names and be keyword ↵Ammar Askar2019-09-211-18/+24
| | | | | | | | | | | | passable (GH-16302) Edit: `math.pow` changes removed on Mark's request. https://bugs.python.org/issue38237 Automerge-Triggered-By: @rhettinger
* bpo-37206: Unrepresentable default values no longer represented as None. ↵Serhiy Storchaka2019-09-141-2/+2
| | | | | | | (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-3/+3
| | | | Argument Clinic. (GH-13593)
* bpo-35766: compile(): rename feature_version parameter (GH-13994)Victor Stinner2019-06-121-5/+9
| | | | | | Rename compile() feature_version parameter to _feature_version and convert it to a keyword-only parameter. Update also test_type_comments to pass feature_version as a tuple.
* bpo-36127: Argument Clinic: inline parsing code for keyword parameters. ↵Serhiy Storchaka2019-03-141-10/+100
| | | | (GH-12058)
* bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086)Guido van Rossum2019-03-071-7/+8
| | | | | | | This adds a `feature_version` flag to `ast.parse()` (documented) and `compile()` (hidden) that allow tweaking the parser to support older versions of the grammar. In particular if `feature_version` is 5 or 6, the hacks for the `async` and `await` keyword from PEP 492 are reinstated. (For 7 or higher, these are unconditionally treated as keywords, but they are still special tokens rather than `NAME` tokens that the parser driver recognizes.) https://bugs.python.org/issue35975
* bpo-35582: Argument Clinic: Optimize the "all boring objects" case. (GH-11520)Serhiy Storchaka2019-01-111-31/+56
| | | | | 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-3/+15
| | | | (GH-11313)
* bpo-23867: Argument Clinic: inline parsing code for a single positional ↵Serhiy Storchaka2018-12-251-2/+8
| | | | parameter. (GH-9689)
* bpo-33012: Fix invalid function cast warnings with gcc 8 in Argument Clinic. ↵Serhiy Storchaka2018-11-271-15/+15
| | | | | | | | (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-34637: Make the *start* argument for *sum()* visible as a keyword ↵Raymond Hettinger2018-09-121-6/+7
| | | | argument. (GH-9208)
* bpo-32240: Add the const qualifier to declarations of PyObject* array ↵Serhiy Storchaka2017-12-151-15/+15
| | | | arguments. (#4746)
* bpo-30950: Convert round() to Argument Clinic. (#2740)Serhiy Storchaka2017-11-151-1/+35
|
* bpo-29464: Rename METH_FASTCALL to METH_FASTCALL|METH_KEYWORDS and make (#1955)Serhiy Storchaka2017-07-031-62/+14
| | | | | 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-48/+48
| | | | | | | | 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".
* Add reference to help('FORMATTING') in format() builtin (GH-166)Amit Kumar2017-05-291-2/+4
|
* Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-171-34/+78
| | | | | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using "boring" positional arguments. Manually fix _elementtree: _elementtree_XMLParser_doctype() must remain consistent with the clinic code.
* Run Argument Clinic: METH_VARARGS=>METH_FASTCALLVictor Stinner2017-01-171-4/+8
| | | | | Issue #29286. Run Argument Clinic to get the new faster METH_FASTCALL calling convention for functions using only positional arguments.
* Rename _PyArg_ParseStack to _PyArg_ParseStackAndKeywordsVictor Stinner2017-01-171-1/+1
| | | | Issue #29286.
* Issue #27810: Rerun Argument Clinic on all modulesVictor Stinner2016-09-101-4/+4
|
* Issue #27574: Decreased an overhead of parsing keyword arguments in functionsSerhiy Storchaka2016-08-141-3/+4
| | | | implemented with using Argument Clinic.
* - Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka2016-07-071-36/+35
|\ | | | | | | generated by Argument Clinic. Patch by Petr Viktorin.
| * Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka2016-07-071-36/+35
| | | | | | | | generated by Argument Clinic. Patch by Petr Viktorin.
* | Issue #26305: Argument Clinic now uses braces in C code as required by PEP 7.Serhiy Storchaka2016-06-091-15/+29
|/