aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/modsupport.c
Commit message (Collapse)AuthorAge
* gh-128629: Add _Py_PACK_VERSION for CPython's own definitions (GH-134247)Petr Viktorin10 days
| | | | | | | | Add _Py_PACK_VERSION for CPython's own definitions Py_PACK_VERSION was added to limited API in 3.14, so if Py_LIMITED_API is lower, the macro can't be used. Add a private version that can be used in CPython headers for checks like `Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 14)`.
* gh-132909: handle overflow for `'K'` format in `do_mkvalue` (#132911)Bénédikt Tran2025-04-25
|
* bpo-45325: Add a new 'p' parameter to Py_BuildValue to convert an integer ↵Pablo Galindo Salgado2025-02-18
| | | | into a Python bool (#28634)
* gh-128629: Add Py_PACK_VERSION and Py_PACK_FULL_VERSION (GH-128630)Petr Viktorin2025-01-09
|
* gh-121040: Use __attribute__((fallthrough)) (#121044)Victor Stinner2024-06-27
| | | | | | | | | | | | | Fix warnings when using -Wimplicit-fallthrough compiler flag. Annotate explicitly "fall through" switch cases with a new _Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) if available. Replace "fall through" comments with _Py_FALLTHROUGH. Add _Py__has_attribute() macro. No longer define __has_attribute() macro if it's not defined. Move also _Py__has_builtin() at the top of pyport.h. Co-Authored-By: Nikita Sobolev <mail@sobolevn.me>
* gh-84489: Properly handle trailing spaces in Py_BuildValue() format strings ↵Zackery Spytz2023-10-11
| | | | | | | | | (GH-21158) The docs state that the space, tab, colon, and comma characters are ignored in Py_BuildValue() format strings. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-42327: C API: Add PyModule_Add() function (GH-23443)Serhiy Storchaka2023-07-18
| | | | | It is a fixed implementation of PyModule_AddObject() which consistently steals reference both on success and on failure.
* gh-105156: Deprecate the old Py_UNICODE type in C API (#105157)Victor Stinner2023-06-01
| | | | | | | | Deprecate the old Py_UNICODE and PY_UNICODE_TYPE types in the C API: use wchar_t instead. Replace Py_UNICODE with wchar_t in multiple C files. Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* gh-104922: Make `PY_SSIZE_T_CLEAN` not mandatory again (#105051)Inada Naoki2023-05-31
|
* gh-94673: Ensure Builtin Static Types are Readied Properly (gh-103940)Eric Snow2023-04-27
| | | There were cases where we do unnecessary work for builtin static types. This also simplifies some work necessary for a per-interpreter GIL.
* gh-102192: Replace PyErr_Fetch/Restore etc by more efficient alternatives ↵Irit Katriel2023-02-28
| | | | (in Python/) (#102193)
* gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516)Eric Snow2022-11-16
| | | https://github.com/python/cpython/issues/81057
* gh-99300: Use Py_NewRef() in Python/ directory (#99302)Victor Stinner2022-11-10
| | | | Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Python/ directory.
* bpo-1635741: Add PyModule_AddObjectRef() function (GH-23122)Victor Stinner2020-11-04
| | | | | Added PyModule_AddObjectRef() function: similar to PyModule_AddObjectRef() but don't steal a reference to the value on success.
* closes bpo-41533: Fix a potential memory leak when allocating a stack (GH-21847)Tony Solomonik2020-08-29
| | | | Free the stack allocated in va_build_stack if do_mkstack fails and the stack is not a small_stack
* bpo-40943: PY_SSIZE_T_CLEAN required for '#' formats (GH-20784)Victor Stinner2020-06-19
| | | | | | | The PY_SSIZE_T_CLEAN macro must now be defined to use PyArg_ParseTuple() and Py_BuildValue() "#" formats: "es#", "et#", "s#", "u#", "y#", "z#", "U#" and "Z#". See the PEP 353. Update _testcapi.test_buildvalue_issue38913().
* bpo-40170: Add _PyIndex_Check() internal function (GH-19426)Victor Stinner2020-04-08
| | | | | | | | | Add _PyIndex_Check() function to the internal C API: fast inlined verson of PyIndex_Check(). Add Include/internal/pycore_abstract.h header file. Replace PyIndex_Check() with _PyIndex_Check() in C files of Objects and Python subdirectories.
* bpo-40024: Add PyModule_AddType() helper function (GH-19088)Dong-hee Na2020-03-22
|
* bpo-38913: Fix segfault in Py_BuildValue("(s#O)", ...) if entered with ↵Serhiy Storchaka2020-03-02
| | | | exception raised. (GH-18656)
* bpo-36381: warn when no PY_SSIZE_T_CLEAN defined (GH-12473)Inada Naoki2019-03-23
| | | We will remove int support from 3.10 or 4.0.
* bpo-29852: Argument Clinic Py_ssize_t converter now supports None (#716)Serhiy Storchaka2017-03-30
| | | if pass `accept={int, NoneType}`.
* bpo-29524: Add Objects/call.c file (#12)Victor Stinner2017-02-12
| | | | | | | | | * Move all functions to call objects in a new Objects/call.c file. * Rename fast_function() to _PyFunction_FastCallKeywords(). * Copy null_error() from Objects/abstract.c * Inline type_error() in call.c to not have to copy it, it was only called once. * Export _PyEval_EvalCodeWithName() since it is now called from call.c.
* Backed out changeset f23fa1f7b68fVictor Stinner2017-02-10
| | | | | Sorry, I didn't want to push this change before the review :-( I was pushing a change into the 2.7 branch.
* Issue #29465: Add Objects/call.c fileVictor Stinner2017-02-10
| | | | | | | | | | * Move all functions to call objects in a new Objects/call.c file. * Rename fast_function() to _PyFunction_FastCallKeywords(). * Copy null_error() from Objects/abstract.c * Inline type_error() in call.c to not have to copy it, it was only called once. * Export _PyEval_EvalCodeWithName() since it is now called from call.c.
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-23
| | | | possible. Patch is writen with Coccinelle.
* Add _Py_VaBuildStack() functionVictor Stinner2016-12-09
| | | | | Issue #28915: Similar to Py_VaBuildValue(), but work on a C array of PyObject*, instead of creating a tuple.
* modsupport: replace int with Py_ssize_tVictor Stinner2016-12-09
| | | | | | | | Issue #28915: Py_ssize_t type is better for indexes. The compiler might emit more efficient code for i++. Py_ssize_t is the type of a PyTuple index for example. Replace also "int endchar" with "char endchar".
* modsupport: replace int with Py_ssize_tVictor Stinner2016-12-09
| | | | Issue #28915.
* Uniformize argument names of "call" functionsVictor Stinner2016-12-06
| | | | | | | | | | | | Issue #28838: Rename parameters of the "calls" functions of the Python C API. * Rename 'callable_object' and 'func' to 'callable': any Python callable object is accepted, not only Python functions * Rename 'method' and 'nameid' to 'name' (method name) * Rename 'o' to 'obj' * Move, fix and update documentation of PyObject_CallXXX() functions in abstract.h * Update also the documentaton of the C API (update parameter names)
* Issue #28748: Private variable _Py_PackageContext is now of type "const char *"Serhiy Storchaka2016-11-21
| | | | rather of "char *".
* Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-20
| | | | functions.
* va_end() all va_copy()ed va_lists.Christian Heimes2016-09-21
|
* replace usage of Py_VA_COPY with the (C99) standard va_copyBenjamin Peterson2016-09-20
|
* replace PY_LONG_LONG with long longBenjamin Peterson2016-09-06
|
* Avoid inefficient way to call functions without argumentVictor Stinner2016-09-05
| | | | | | Don't pass "()" format to PyObject_CallXXX() to call a function without argument: pass NULL as the format string instead. It avoids to have to parse a string to produce 0 argument.
* require a long long data type (closes #27961)Benjamin Peterson2016-09-05
|
* Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"Serhiy Storchaka2016-05-20
|\ | | | | | | format unit.
| * Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"Serhiy Storchaka2016-05-20
| | | | | | | | format unit.
* | Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka2015-12-25
|/ | | | private functions.
* Issue #20024: Py_BuildValue() now saves/restores the current exception beforeVictor Stinner2014-01-21
| | | | building an item if the build of a previous item failed.
* modsupport.c reuses Py_UNICODE_strlen()Victor Stinner2011-09-29
|
* Py_BuildValue("C") supports non-BMP characters on narrow buildVictor Stinner2011-07-15
| | | | | | Py_BuildValue("C") doesn't have to check the code point, PyUnicode_FromOrdinal() checks its input and now supports non-BMP characters (range U+10000-U+10FFFF).
* Issue #2443: Added a new macro, Py_VA_COPY, which is equivalent to C99Alexander Belopolsky2010-08-11
| | | | | va_copy, but available on all python platforms. Untabified a few unrelated files.
* Issue #8848: U / U# formats of Py_BuildValue() are just alias to s / s#Victor Stinner2010-06-07
|
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-09
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Issue 7147 - remove ability to attempt to build Python without complex ↵Skip Montanaro2009-10-18
| | | | number support (was broken anyway)
* Py_BuildValue's 'c' code should use byte strings #5666Benjamin Peterson2009-04-03
|
* Correct a typo during previous checkin.Amaury Forgeot d'Arc2008-07-04
|
* Issue #3280: like chr() already does, the "%c" format now accepts the full ↵Amaury Forgeot d'Arc2008-07-04
| | | | | | unicode range even on "narrow Unicode" builds; the result is a pair of UTF-16 surrogates.
* Implement PEP 3121: new module initialization and finalization API.Martin v. Löwis2008-06-11
|