summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* gh-103968: Deprecate creating heap types whose metaclass has custom tp_new. ↵Petr Viktorin2023-05-031-2/+24
| | | | | | | | (GH-103972) (That's a mouthful of an edge case!) Co-authored-by: Barney Gale <barney.gale@gmail.com>
* GH-98040: Suppress cross-references to the removed ``imp`` module (#104131)Adam Turner2023-05-031-2/+2
| | | Suppress cross-references to imp
* gh-103743: Add PyUnstable_Object_GC_NewWithExtraData (GH-103744)Jurica Bradarić2023-05-021-1/+20
| | | | Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-98040: Remove just the `imp` module (#98573)Barry Warsaw2023-04-281-0/+2
|
* Docs: fix dunders with too many underscores (#103955)Erlend E. Aasland2023-04-271-1/+1
|
* gh-103883: Doc: Move PyUnicode_FromObject doc (#103913)Inada Naoki2023-04-271-9/+9
| | | This API is one of Unicode creator APIs.
* gh-103091: Add PyUnstable_Type_AssignVersionTag (#103095)Brett Simmers2023-04-241-0/+9
|
* gh-101100: Test docs in nit-picky mode (#102513)Hugo van Kemenade2023-03-242-1/+11
| | | | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-102595: Document `PyObject_Format` c-api function (GH-102596)Nikita Sobolev2023-03-211-0/+9
| | | Def: https://github.com/python/cpython/blame/5ffdaf748d98da6065158534720f1996a45a0072/Include/abstract.h#L389
* gh-102755: Add PyErr_DisplayException(exc) (#102756)Irit Katriel2023-03-161-0/+6
|
* gh-101100: Documenting --prefix and --exec-prefix. (GH-102695)Julien Palard2023-03-152-6/+6
| | | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-102013: Add PyUnstable_GC_VisitObjects (#102014)Jacob Bower2023-03-141-0/+33
|
* gh-102381: don't call watcher callback with dead object (#102382)Carl Meyer2023-03-083-10/+45
| | | Co-authored-by: T. Wouters <thomas@python.org>
* gh-102383: [docs] Arguments of `PyObject_CopyData` are `PyObject *` (#102390)Nikita Sobolev2023-03-031-1/+1
|
* gh-101101: Unstable C API tier (PEP 689) (GH-101102)Petr Viktorin2023-02-282-9/+125
|
* Fix typo in `Py_GetPythonHome` signature (#102168)Tanner Firl2023-02-231-1/+1
|
* gh-101578: Amend exception docs (#102057)Erlend E. Aasland2023-02-211-22/+23
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-101578: Amend PyErr_{Set,Get}RaisedException docs (#101962)Erlend E. Aasland2023-02-191-32/+17
| | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* Docs: fix typos in PyFunction_WatchCallback docs and in 3.12 NEWS (GH-101980)Yeojin Kim2023-02-171-1/+1
| | | | - possitibility => possibility - disaallowed => disallowed
* gh-101973: Fix parameter reference for PyModule_FromDefAndSpec (#101976)Oleg Iarygin2023-02-171-2/+2
|
* GH-101898: Fix missing term references for hashable definition (#101899)Furkan Onder2023-02-142-2/+2
| | | Fix missing term references for hashable definition
* GH-99293: Document that `Py_TPFLAGS_VALID_VERSION_TAG` shouldn't be used. ↵Mark Shannon2023-02-091-0/+10
| | | | | | | | (#GH-101736) Document that Py_TPFLAGS_VALID_VERSION_TAG shouldn't be used.
* GH-101578: Normalize the current exception (GH-101607)Mark Shannon2023-02-081-1/+78
| | | | | | | | | | * Make sure that the current exception is always normalized. * Remove redundant type and traceback fields for the current exception. * Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException * Add new API functions: PyException_GetArgs, PyException_SetArgs
* Add missing `versionadded` directive for `PyCode_Addr2Location` (#101347)Max Bachmann2023-02-041-0/+2
|
* gh-101386: fix typos found by codespell (#101387)Peter Jiping Xie2023-01-281-2/+2
|
* [docs] Mention how to get/set a bigint PyLong via the C API (#101270)Gregory P. Smith2023-01-241-0/+4
| | | | | | We don't need direct C APIs to get at a bigint representation of PyLong but we do want the few people who need to understand how. Additional Author: CAM-Gerlach
* Fix typos in Doc folder (#100880)Semen Zhydenko2023-01-101-1/+1
|
* docs: fix `ssizeobjargproc` parameters (#100736)David Lechner2023-01-041-1/+2
|
* Fix deprecation doc for `PyEval_InitThreads` (#100667)Alexander Shadchin2023-01-021-2/+2
|
* gh-98712: Clarify "readonly bytes-like object" semantics in C arg-parsing ↵Petr Viktorin2022-12-231-19/+35
| | | | docs (#98710)
* Docs: Use `PY_VERSION_HEX` for version comparison (#100179)Hugo van Kemenade2022-12-171-0/+2
|
* gh-97909: Fix markup for `PyMethodDef` members (#100089)ram vikram singh2022-12-171-17/+18
|
* gh-99767: mark `PyTypeObject.tp_watched` as internal use only in table (#100271)Carl Meyer2022-12-161-1/+1
|
* GH-99767: update PyTypeObject docs for type watchers (GH-99928)Carl Meyer2022-12-151-0/+9
|
* gh-98724: Fix Py_CLEAR() macro side effects (#99100) (#100070)Victor Stinner2022-12-071-2/+44
| | | | | | | | | | | | | | The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate their arguments once. If an argument has side effects, these side effects are no longer duplicated. Use temporary variables to avoid duplicating side effects of macro arguments. If available, use _Py_TYPEOF() to avoid type punning. Otherwise, use memcpy() for the assignment to prevent a miscompilation with strict aliasing caused by type punning. Add _Py_TYPEOF() macro: __typeof__() on GCC and clang. Add test_py_clear() and test_py_setref() unit tests to _testcapi.
* GH-91054: Add code object watchers API (GH-99859)Itamar Ostricher2022-12-021-0/+48
| | | | | | * Add API to allow extensions to set callback function on creation and destruction of PyCodeObject Co-authored-by: Ye11ow-Flash <janshah@cs.stonybrook.edu>
* gh-99249: Clarify "read-only" slots tp_bases & tp_mro (GH-99342)Petr Viktorin2022-11-281-6/+25
| | | | | | | | | | | | | | | | | These slots are marked "should be treated as read-only" in the table at the start of the document. That doesn't say anything about setting them in the static struct. `tp_bases` docs did say that it should be ``NULL`` (TIL!). If you ignore that, seemingly nothing bad happens. However, some slots may not be inherited, depending on which sub-slot structs are present. (FWIW, NumPy sets tp_bases and is affected by the quirk -- though to be fair, its DUAL_INHERIT code probably predates tp_bases docs, and also the result happens to be benign.) This patch makes things explicit. It also makes the summary table legend easier to scan. Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* Revert "gh-98724: Fix Py_CLEAR() macro side effects" (#99737)Victor Stinner2022-11-241-44/+2
| | | | | Revert "gh-98724: Fix Py_CLEAR() macro side effects (#99100)" This reverts commit c03e05c2e72f3ea5e797389e7d1042eef85ad37a.
* gh-93937: Document PyFrame_Check and PyFrame_Type (GH-99695)Petr Viktorin2022-11-221-0/+18
|
* gh-91053: Add an optional callback that is invoked whenever a function is ↵mpage2022-11-221-0/+60
| | | | modified (#98175)
* gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h ↵Petr Viktorin2022-11-221-61/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-99014) The ``structmember.h`` header is deprecated, though it continues to be available and there are no plans to remove it. There are no deprecation warnings. Old code can stay unchanged (unless the extra include and non-namespaced macros bother you greatly). Specifically, no uses in CPython are updated -- that would just be unnecessary churn. The ``structmember.h`` header is deprecated, though it continues to be available and there are no plans to remove it. Its contents are now available just by including ``Python.h``, with a ``Py`` prefix added if it was missing: - `PyMemberDef`, `PyMember_GetOne` and`PyMember_SetOne` - Type macros like `Py_T_INT`, `Py_T_DOUBLE`, etc. (previously ``T_INT``, ``T_DOUBLE``, etc.) - The flags `Py_READONLY` (previously ``READONLY``) and `Py_AUDIT_READ` (previously all uppercase) Several items are not exposed from ``Python.h``: - `T_OBJECT` (use `Py_T_OBJECT_EX`) - `T_NONE` (previously undocumented, and pretty quirky) - The macro ``WRITE_RESTRICTED`` which does nothing. - The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of `Py_AUDIT_READ`. - In some configurations, ``<stddef.h>`` is not included from ``Python.h``. It should be included manually when using ``offsetof()``. The deprecated header continues to provide its original contents under the original names. Your old code can stay unchanged, unless the extra include and non-namespaced macros bother you greatly. There is discussion on the issue to rename `T_PYSSIZET` to `PY_T_SSIZE` or similar. I chose not to do that -- users will probably copy/paste that with any spelling, and not renaming it makes migration docs simpler. Co-Authored-By: Alexander Belopolsky <abalkin@users.noreply.github.com> Co-Authored-By: Matthias Braun <MatzeB@users.noreply.github.com>
* Doc: Replace question mark with fullstop (#99558)Rafael Fontenelle2022-11-181-1/+1
| | | | The sentence "Set the LC_CTYPE locale to the user preferred locale." should end with a period instead of a question mark.
* gh-99377: Revert audit events for thread state creation and free, because ↵Steve Dower2022-11-171-13/+0
| | | | the GIL is not properly held at these times (GH-99543)
* gh-99377: Add audit events for thread creation and clear (GH-99378)Steve Dower2022-11-161-0/+13
|
* gh-91248: Optimize PyFrame_GetVar() (#99252)Victor Stinner2022-11-131-0/+2
| | | | PyFrame_GetVar() no longer creates a temporary dictionary to get a variable.
* gh-98724: Fix Py_CLEAR() macro side effects (#99100)Victor Stinner2022-11-091-2/+44
| | | | | | | The Py_CLEAR(), Py_SETREF() and Py_XSETREF() macros now only evaluate their argument once. If an argument has side effects, these side effects are no longer duplicated. Add test_py_clear() and test_py_setref() unit tests to _testcapi.
* gh-91248: Add PyFrame_GetVar() function (#95712)Victor Stinner2022-11-081-0/+19
| | | | | | Add PyFrame_GetVar() and PyFrame_GetVarString() functions to get a frame variable by its name. Move PyFrameObject C API tests from test_capi to test_frame.
* gh-96746: Docs: Clear up Py_TPFLAGS_DISALLOW_INSTANTIATION inheritance ↵Petr Viktorin2022-11-071-0/+11
| | | | | | | (GH-99002) The flag is not inherited, but its effect -- a NULL tp_new -- is. Drop hints for people who come here wanting to “disallow instantiation”.
* gh-98586: Add What's New entry and update docs (#99056)Wenzel Jakob2022-11-061-1/+1
| | | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-97909: PyMemberDef & PyGetSetDef members are not marked up (GH-98810)Johnny115022022-11-031-17/+19
|