Commit Graph

2013 Commits

Author SHA1 Message Date
Petr Viktorin 91cd2e5806 gh-146175: Soft-deprecate outdated macros; convert internal usage (GH-146178)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-23 12:42:09 +01:00
Serhiy Storchaka 3776aba204 Update docs for gh-146056 (GH-146213) 2026-03-22 09:29:04 +02:00
Sergey B Kirpichev 52c01864c4 gh-145633: Refine notes on non-IEEE platforms (#145845)
* We don't specify what happens on non-IEEE platforms.
* Use rather PY_LITTLE_ENDIAN to get native endianness.
* Mention that unpack functions don't fail in CPython.
* Mention that PyFloat_Pack8 doesn't fail in CPython.

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-19 11:42:25 +00:00
Carlos Sousa 004ce8d97b gh-137696: Rename 'fort' parameter to 'order' in PyBuffer_* functions (#137866) 2026-03-19 16:54:27 +05:30
Serhiy Storchaka becd7a967f gh-146143: Fix the PyUnicodeWriter_WriteUCS4() signature (GH-146144)
It now accepts a pointer to constant buffer of Py_UCS4.
2026-03-19 08:23:01 +00:00
Serhiy Storchaka 0f2246b155 gh-146056: Fix list.__repr__() for lists containing NULLs (GH-146129)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-19 09:59:48 +02:00
Lysandros Nikolaou 5b25eaec37 gh-142518: Annotate PyList_* C APIs for thread safety (#146109) 2026-03-18 17:42:20 +01:00
Lysandros Nikolaou 847f83ef1c gh-142518: Add thread safety notes for the buffer protocol (#145911) 2026-03-18 14:18:28 +01:00
RayXu 70397fd103 Docs: fix a form error and a grammatical error in float.rst (#140989) 2026-03-16 13:51:49 +05:30
Victor Stinner 3c38feb2a2 gh-129813: Document that PyBytesWriter_GetData() cannot fail (#145900)
Document that PyBytesWriter_GetData() and PyBytesWriter_GetSize()
getter functions cannot fail
2026-03-13 19:44:51 +01:00
Victor Stinner d4cc553294 gh-141510: Update PyDict C API doc for frozendict (#145533)
Mention frozendict support.
2026-03-12 15:04:36 +01:00
Lysandros Nikolaou 7a1da4575b gh-142518: Improve mimalloc allocator docs (#145224) 2026-03-11 15:14:47 +01:00
Sergey B Kirpichev dae85c4d93 gh-145633: Remove support for ancient ARM platforms with mixed-endian doubles (#145634)
* Drop DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 macro.
* Use DOUBLE_IS_BIG/LITTLE_ENDIAN_IEEE754 to detect endianness of
  float/doubles.
* Drop "unknown_format" code path in PyFloat_Pack/Unpack*().

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-11 12:39:24 +01:00
Farhan Saif bf4017b161 gh-125053: Document that ob_mutex must only be used via critical section API (#144599)
Add a warning in the free-threading extensions howto explaining that
PyObject.ob_mutex is reserved for the critical section API and must not
be locked directly with PyMutex_Lock, as this can cause deadlocks.
Extension authors who need their own lock should add a separate PyMutex
field to their object struct.

Also add an ob_mutex member entry under PyObject in the C API reference
(Doc/c-api/structures.rst) with a cross-reference to the howto.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-03-10 17:23:39 +01:00
Peter Bierma 7990313afa Docs: Improve the C API documentation involving threads (GH-145520)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-10 10:57:13 -04:00
Hugo van Kemenade 6024d3c6da Python 3.15.0a7 2026-03-10 14:31:15 +02:00
Petr Viktorin 44855458a4 Document that PyType_GetModule returns a borrowed ref (GH-145612) 2026-03-09 14:32:28 +01:00
Victor Stinner 9159287f58 gh-144175: Add PyArg_ParseArray() function (#144283)
Add PyArg_ParseArray() and PyArg_ParseArrayAndKeywords()
functions to parse arguments of functions using the METH_FASTCALL
calling convention.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-03-06 21:57:44 +00:00
Victor Stinner 0c29f83caa gh-141510: No longer accept frozendict in PyDict_Copy() (#145542)
Rename _PyDict_Copy() to anydict_copy().

Replace PyObject_IsInstance(op, &PyFrozenDict_Type) with
PyFrozenDict_Check().
2026-03-05 15:26:54 +01:00
Victor Stinner 31343cf2bc gh-142417: Restore private _Py_InitializeMain() function (#145472)
This reverts commit 07c3518ffb.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-03-04 11:00:08 +01:00
Petr Viktorin 3b276f3f59 gh-144748: Make PyErr_CheckSignals raise the exception scheduled by PyThreadState_SetAsyncExc (GH-145178)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-03-02 11:47:32 +01:00
Taegyun Kim 8775f90017 gh-144693: Clarify that PyFrame_GetBack does not raise exceptions (GH-144824)
Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-02-27 10:25:46 -05:00
Peter Bierma dc1b56aa03 gh-141004: Document missing type flags (GH-145127) 2026-02-27 10:11:52 -05:00
Pieter Eendebak 4401f23cbf gh-141510: Update PyDict_Copy documentation with note on frozendict (GH-145249) 2026-02-26 11:00:22 -05:00
Peter Bierma 24cc998c16 gh-141004: Document PyModuleDef_Type (GH-145043) 2026-02-23 15:18:45 +01:00
Victor Stinner 25fc04d041 gh-141510: Test frozendict in test_capi.test_dict (#145084)
Complete PyDict_Clear() documentation.
2026-02-21 20:07:30 +01:00
Peter Bierma 06292614ff gh-144748: Document 3.12 and 3.14 changes to PyErr_CheckSignals (GH-144982)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-20 19:25:45 -05:00
Peter Bierma 60f3c396fe gh-141811: Split up init.rst into multiple pages (GH-144844)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
2026-02-20 16:37:39 +00:00
Ned Batchelder 852ec18978 Docs: remove unneeded author attributions (#145002)
These directives are not maintained and misleadingly indicate individual
rather than community ownership.

See https://github.com/python/docs-community/issues/180 for discussion,
and https://github.com/python/devguide/pull/1740 for an update to the
devguide.

Also ensured that everyone is in the Misc/ACKS file.
2026-02-19 18:45:28 -05:00
Victor Stinner 696cdfc0a2 gh-141510, PEP 814: Add built-in frozendict type (#144757)
Add TYPE_FROZENDICT to the marshal module.

Add C API functions:

* PyAnyDict_Check()
* PyAnyDict_CheckExact()
* PyFrozenDict_Check()
* PyFrozenDict_CheckExact()
* PyFrozenDict_New()

Add PyFrozenDict_Type C type.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Johnson <me@adamj.eu>
Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
2026-02-17 10:54:41 +01:00
Kumar Aditya 50c479e613 add whatsnew entry for PyUnstable_SetImmortal and PyDatetime_IMPORT (#144830) 2026-02-15 20:21:54 +05:30
Victor Stinner 9e5e1f9988 gh-121617: Include <string.h> for Py_CLEAR() macro (#144666)
Python.h now also includes <string.h> in the limited C API version 3.11
and newer to fix the Py_CLEAR() macro which uses memcpy().

Add a Py_CLEAR() test in test_cext.

Modify also _Py_TYPEOF to use C23 typeof() if available.
2026-02-12 17:03:55 +01:00
Pablo Galindo Salgado 46d5106cfa gh-142349: Implement PEP 810 - Explicit lazy imports (#142351)
Co-authored-by: T. Wouters <twouters@meta.com >
Co-authored-by: Brittany Reynoso <breynoso@meta.com>
Co-authored-by: Dino Viehland <dinoviehland@meta.com>
2026-02-12 00:15:33 +00:00
Ronald Eddy Jr 3718f4be60 Fix typos and grammar errors across documentation (#144709) 2026-02-11 16:35:25 +00:00
Kumar Aditya 347d3594d3 gh-143300: implement PyUnstable_SetImmortal for marking objects as immortal (#144543) 2026-02-11 20:59:31 +05:30
Petr Viktorin b22ff1e543 gh-140550: allow slots that repeat information from PyModuleDef (GH-144340)
When integrating slots-based module creation is with the inittab,
which currently requires PyModuleDef, it would be convenient to
reuse the the same slots array for the MethodDef.

Allow slots that match what's already present in the PyModuleDef.
2026-02-09 11:35:43 +01:00
Petr Viktorin f85e1170d2 gh-141004: Reorganize and reword the 'Useful macros' section (GH-144471)
- Group the macros
- Roughly order them to put the most important ones first
- Add expansions where it makes sense; especially if there's
  an equivalent in modern C or a common compiler

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2026-02-06 11:55:11 +01:00
Peter Bierma 914fbec214 gh-141004: Document remaining pyport.h utility macros (GH-144279)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-02-04 11:43:47 -05:00
Peter Bierma 3a0e183556 gh-144277: Fix usage of free-threaded terminology in the documentation (GH-144333) 2026-02-01 20:39:26 -05:00
Pablo Galindo Salgado b1bc868fba gh-144319: Add huge pages support for pymalloc (#144320) 2026-01-29 12:26:11 +00:00
Nathan Goldbaum f2b5c206c7 gh-143883: Use named parameters in PyModExport-related declarations & docs (GH-143884) 2026-01-27 10:28:28 +00:00
Nathan Goldbaum 3e9a5b022f gh-144257: document return values of PyModule_SetDocString (GH-144258)
Co-authored-by: sobolevn <mail@sobolevn.me>
2026-01-27 02:15:16 -05:00
Petr Viktorin fb690c38ca gh-141004: Mark up constants for PyOS_double_to_string (GH-143867)
This ensures they show up as C macros in search and the Sphinx inventory.
2026-01-22 11:53:17 +01:00
Sergey B Kirpichev 4c7ec78092 gh-143869: Add PEP 757 functions to the limited API (#143906)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-01-21 14:47:14 +01:00
Sergey B Kirpichev d8ab1c79b0 gh-75459: versionadded for PyObject_CallFinalizer*() API (GH-143982) 2026-01-19 11:22:16 +01:00
Peter Bierma d51c01a271 gh-141004: Document PyException_HEAD and PyDescr_COMMON (GH-143896) 2026-01-17 10:39:29 -05:00
Peter Bierma 19e64afddf gh-141070: Rename PyUnstable_Object_Dump to PyObject_Dump (GH-142848) 2026-01-16 09:19:43 -05:00
Petr Viktorin a009e78b79 gh-141004: Mark up docs of old PyMem macros (GH-143783)
These had a docs-only deprecation notice since the first version of the docs in this repo. Nowadays we call things “soft deprecated” if there's just a note in the docs.

The deprecated directive needs a version, I went with the first one that had the notice (2.0; it's not in 1.6):
- https://docs.python.org/release/2.0/api/memoryInterface.html
- https://docs.python.org/release/1.6/api/memoryInterface.html

Since PEP 445, they are now direct aliases; there are no (additional) binary compatibility concerns over the preferred names.
2026-01-15 12:37:30 +01:00
Muneeb Ullah 421bd1770a gh-143834: Fix PyLong_AsNativeBytes docs for negative number padding (GH-143840) 2026-01-15 09:22:01 +01:00
Peter Bierma 0e0d51cdce gh-141004: Document several soft-deprecated C APIs (GH-141634)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-01-14 08:20:33 -05:00