summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* Docs: Clarify availability of PyOS_CheckStack (GH-91816)Petr Viktorin2022-04-221-3/+3
|
* gh-91768: C API no longer use "const PyObject*" type (#91769)Victor Stinner2022-04-211-7/+12
| | | | | | | | | | | | | Py_REFCNT(), Py_TYPE(), Py_SIZE() and Py_IS_TYPE() functions argument type is now "PyObject*", rather than "const PyObject*". * Replace also "const PyObject*" with "PyObject*" in functions: * _Py_strhex_impl() * _Py_strhex_with_sep() * _Py_strhex_bytes_with_sep() * Remove _PyObject_CAST_CONST() and _PyVarObject_CAST_CONST() macros. * Py_IS_TYPE() can now use Py_TYPE() in its implementation.
* GH-88116: Document that PyCodeNew is dangerous, and make PyCode_NewEmpty ↵Mark Shannon2022-04-211-6/+15
| | | | less dangerous. (GH-91790)
* GH-88756: Update docs for PEP 523 eval function type. (GH-91788)Mark Shannon2022-04-211-1/+4
|
* bpo-40421: Cleanup PyFrame C API (GH-32417)Victor Stinner2022-04-191-16/+2
|
* gh-91118: Fix docstrings that do not honor --without-doc-strings (#31769)Oleg Iarygin2022-04-181-4/+4
| | | | Co-authored-by: Éric <merwok@netwok.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531)Irit Katriel2022-04-151-4/+40
|
* Add new PyFrame_GetLasti C-API function (GH-32413)Mark Shannon2022-04-081-0/+11
|
* c-api docs: There are five fields, not four (GH-32379)Jelle Zijlstra2022-04-071-1/+1
|
* bpo-47115: Document which parts of structs are in limited API/stable ABI ↵Petr Viktorin2022-04-061-2/+4
| | | | | | (GH-32196) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
* Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API ↵Victor Stinner2022-04-061-10/+1
| | | | | | | | | | | (GH-32052)" (GH-32343) * Revert "bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)" This reverts commit f877b40e3f7e0d97878884d80fbec879a85ab7e8. * Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)" This reverts commit b9a5522dd952125a99ff554f01f311cae25f5a91.
* More minor fixes to C API docs (GH-31714)Jelle Zijlstra2022-04-025-11/+9
| | | | | | | * init_config: wording fixes * bytearray: remove XXX, there is a good link to the buffer docs * bytes, call, exceptions: minor wording fixes
* More minor fixes to C API docs (GH-31525)Jelle Zijlstra2022-04-0213-29/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | * wording fixes in type.rst * grammar and punctuation in sys.rst * set: grammar fixes * structures: capitalization fix * grammar fixes for sequence * objects: point to Py_TYPE instead of direct object access * numbers: add more explicit Python equivalences * method: add missing period * memory: grammar fix * mapping: grammar fixes * long: grammar fix * iter: fix grammar for PyAIter_Check * init: grammar fix
* bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API ↵Victor Stinner2022-04-011-1/+10
| | | | | | | | | | | (GH-32054) Move the private _PyFrameEvalFunction type, and private _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions to the internal C API. The _PyFrameEvalFunction callback function type now uses the _PyInterpreterFrame type which is part of the internal C API. Update the _PyFrameEvalFunction documentation.
* bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114)Mark Shannon2022-03-311-0/+35
|
* bpo-47164: Add _PyCFunction_CAST() macro (GH-32192)Victor Stinner2022-03-311-0/+3
| | | Use the macro in C files of the Python/ directory.
* bpo-47126: Update to canonical PEP URLs specified by PEP 676 (GH-32124)Hugo van Kemenade2022-03-301-1/+1
|
* bpo-42197: Don't create `f_locals` dictionary unless we actually need it. ↵Mark Shannon2022-03-251-0/+11
| | | | | | | | | | | (GH-32055) * `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing. (Contributed by Fabio Zadrozny) * Make accesses to a frame's `f_locals` safe from C code, not relying on calls to `PyFrame_FastToLocals` or `PyFrame_LocalsToFast`. * Document new `PyFrame_GetLocals` C-API function.
* bpo-46836: Add Doc/c-api/frame.rst (GH-32051)Victor Stinner2022-03-234-43/+49
| | | Reorganize the documentation of the PyFrameObject C API.
* bpo-46906: Mention native endian in PyFloat_Pack8() doc (GH-31866)Victor Stinner2022-03-141-2/+6
|
* bpo-46906: Add PyFloat_Pack8() to the C API (GH-31657)Victor Stinner2022-03-111-0/+82
| | | | | | | | | | | | | | | | | | | | | | Add new functions to pack and unpack C double (serialize and deserialize): * PyFloat_Pack2(), PyFloat_Pack4(), PyFloat_Pack8() * PyFloat_Unpack2(), PyFloat_Unpack4(), PyFloat_Unpack8() Document these functions and add unit tests. Rename private functions and move them from the internal C API to the public C API: * _PyFloat_Pack2() => PyFloat_Pack2() * _PyFloat_Pack4() => PyFloat_Pack4() * _PyFloat_Pack8() => PyFloat_Pack8() * _PyFloat_Unpack2() => PyFloat_Unpack2() * _PyFloat_Unpack4() => PyFloat_Unpack4() * _PyFloat_Unpack8() => PyFloat_Unpack8() Replace the "unsigned char*" type with "char*" which is more common and easy to use.
* Add missing "to" to two tp_flags notes (GH-31624)Brandt Bucher2022-03-011-2/+2
|
* bpo-46836: Move PyFrameObject to pycore_frame.h (GH-31530)Victor Stinner2022-02-251-2/+10
| | | | Move the PyFrameObject type definition (struct _frame) to the internal C API pycore_frame.h header file.
* bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535)Victor Stinner2022-02-231-2/+2
| | | | Fix PyFrame_GetBack() and PyFrame_GetCode() return type in the documentation.
* Minor fixes to C API docs (GH-31501)Jelle Zijlstra2022-02-234-24/+28
| | | | | | | | | | | | | | | | * C API docs: move PyErr_SetImportErrorSubclass docs It was in the section about warnings, but it makes more sense to put it with PyErr_SetImportError. * C API docs: document closeit argument to PyRun_AnyFileExFlags It was already documented for PyRun_SimpleFileExFlags. * textual fixes to unicode docs * Move paragraph about tp_dealloc into tp_dealloc section * __aiter__ returns an async iterator, not an awaitable
* bpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)Petr Viktorin2022-02-111-0/+17
| | | | | * Make PyType_GetModuleByDef public (remove underscore) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-46608: exclude marshalled-frozen data if deep-freezing to save 300 KB ↵Kumar Aditya2022-02-041-0/+4
| | | | | | | | | | | | | space (GH-31074) This reduces the size of the data segment by **300 KB** of the executable because if the modules are deep-frozen then the marshalled frozen data just wastes space. This was inspired by comment by @gvanrossum in https://github.com/python/cpython/pull/29118#issuecomment-958521863. Note: There is a new option `--deepfreeze-only` in `freeze_modules.py` to change this behavior, it is on be default to save disk space. ```console # du -s ./python before 27892 ./python # du -s ./python after 27524 ./python ``` Automerge-Triggered-By: GH:ericsnowcurrently
* bpo-45459: Add Py_buffer to limited API (GH-29991)Christian Heimes2022-02-022-6/+12
| | | | | | | | | | | - [x] ``Py_buffer`` struct - [x] ``PyBuffer_*()`` API functions - [x] ``PyBUF_*`` constants - [x] ``Py_bf_getbuffer`` and ``Py_bf_releasebuffer`` type slots - [x] ``PyMemoryView_FromBuffer()`` API - [x] tests for limited API - [x] ``make regen-limited-abi`` - [x] documentation update - [ ] export ``PyPickleBuffer*()`` API ???
* no-issue: Fix documentation typos. (GH-30576)Piotr Fusik2022-01-201-1/+1
|
* bpo-22039: [doc] clarify that there are no plans to disable deleting an ↵Irit Katriel2022-01-191-2/+3
| | | | attribute via PyObject_SetAttr (GH-30639)
* closes bpo-46253: Change Py_UNICODE to Py_UCS4 in the C API docs to match ↵Julian Gilbey2022-01-111-17/+17
| | | | the current source code (GH-30387)
* bpo-46140: take more Py_buffer arguments as const * (GH-30217)David Hewitt2021-12-222-6/+5
|
* Revert "bpo-46131: add fastpath for PyFloat_Check() (GH-30200)" (GH-30208)Raymond Hettinger2021-12-191-1/+0
| | | This reverts commit 2ef06d412531d1163dbc72877c88aedf3ed82a25.
* bpo-46131: add fastpath for PyFloat_Check() (#30200)Matti Picus2021-12-191-0/+1
|
* Doc: some rst linting. (GH-30149)Julien Palard2021-12-171-1/+1
|
* bpo-45855: document that `no_block` has no use anymore in PyCapsule_Import ↵Georg Brandl2021-12-121-3/+4
| | | | (#29665)
* bpo-43931: Export Python version as API data (GH-25577)Gabriele N. Tornetta2021-12-102-0/+11
| | | | | When Python is embedded in other applications, it is not easy to determine which version of Python is being used. This change exposes the Python version as part of the API data. Tools like Austin (https://github.com/P403n1x87/austin) can benefit from this data when targeting applications like uWSGI, as the Python version can then be inferred systematically by looking at the exported symbols rather than relying on unreliable pattern matching or other hacks (like remote code execution etc...). Automerge-Triggered-By: GH:pablogsal
* bpo-45582: Port getpath[p].c to Python (GH-29041)Steve Dower2021-12-031-13/+28
| | | | | The getpath.py file is frozen at build time and executed as code over a namespace. It is never imported, nor is it meant to be importable or reusable. However, it should be easier to read, modify, and patch than the previous code. This commit attempts to preserve every previously tested quirk, but these may be changed in the future to better align platforms.
* bpo-45954: Rename PyConfig.no_debug_ranges to code_debug_ranges (GH-29886)Victor Stinner2021-12-021-3/+6
| | | | | | | Rename PyConfig.no_debug_ranges to PyConfig.code_debug_ranges and invert the value. Document -X no_debug_ranges and PYTHONNODEBUGRANGES env var in PyConfig.code_debug_ranges documentation.
* bpo-45711: Change exc_info related APIs to derive type and traceback from ↵Irit Katriel2021-11-301-1/+6
| | | | the exception instance (GH-29780)
* bpo-45250: fix docs regarding `__iter__` and iterators being inconsistently ↵Brett Cannon2021-11-202-13/+14
| | | | | required by CPython (GH-29170) It is now considered a historical accident that e.g. `for` loops and the `iter()` built-in function do not require the iterators they work with to define `__iter__`, only `__next__`.
* bpo-28737: Document when tp_dealloc should call PyObject_GC_UnTrack() (GH-29246)Sam Gross2021-10-272-8/+20
| | | | | Objects that support garbage collection ("container" objects) should call PyObject_GC_UnTrack() from their destructors before clearing any fields which may point to other "container" objects.
* [doc]: Fix missing space in c-api/init.rst and add rstlint rule (GH-28988)Julien Palard2021-10-191-2/+2
|
* bpo-43760: Add PyThreadState_EnterTracing() (GH-28542)Victor Stinner2021-10-151-0/+24
| | | | | | | | | | Add PyThreadState_EnterTracing() and PyThreadState_LeaveTracing() functions to the limited C API to suspend and resume tracing and profiling. Add an unit test on the PyThreadState C API to _testcapi. Add also internal _PyThreadState_DisableTracing() and _PyThreadState_ResetTracing().
* [doc] Fix typos found using codespell (GH-28744)Christian Clauss2021-10-052-3/+3
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515)Serhiy Storchaka2021-09-221-3/+3
| | | | | | | Replace old names when they refer to actual versions of macOS. Keep historical names in references to older versions. Co-authored-by: Patrick Reader <_@pxeger.com>
* Clean up initialization __class_getitem__ with Py_GenericAlias. (GH-28450)Serhiy Storchaka2021-09-191-1/+1
| | | | | The cast to PyCFunction is redundant. Overuse of redundant casts can hide actual bugs.
* Fix minor typo in Doc/c-api/type.rst (GH-28432)Konstantin Popov2021-09-181-1/+1
| | | retreived-> retrieved
* bpo-45116: Py_DEBUG ignores Py_ALWAYS_INLINE (GH-28419)Victor Stinner2021-09-171-0/+3
| | | | If the Py_DEBUG macro is defined, the Py_ALWAYS_INLINE macro does nothing.
* bpo-45116: Add the Py_ALWAYS_INLINE macro (GH-28390)Victor Stinner2021-09-171-0/+19
| | | | | Add the Py_ALWAYS_INLINE macro to ask the compiler to always inline a static inline function. The compiler can ignore it and decides to not inline the function.