summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* gh-93103: Update PyUnicode_DecodeFSDefault() doc (#93105)Victor Stinner2022-05-231-38/+24
| | | | | | | Update documentation of PyUnicode_DecodeFSDefault(), PyUnicode_DecodeFSDefaultAndSize() and PyUnicode_EncodeFSDefault(): they now use the filesystem encoding and error handler of PyConfig, Py_FileSystemDefaultEncoding and Py_FileSystemDefaultEncodeErrors variables are no longer used.
* gh-93103: Deprecate global configuration variable (#93104)Victor Stinner2022-05-232-7/+119
| | | | | Deprecate global configuration variables, like Py_IgnoreEnvironmentFlag, in the documentation: the Py_InitializeFromConfig() API should be instead.
* gh-92913: Clarify changes to PyInitConfig.module_search_paths[_set] fields ↵Steve Dower2022-05-191-4/+16
| | | | (GH-92980)
* gh-91755: Remove doc of C API private refcount functions (#92918)Victor Stinner2022-05-181-6/+0
| | | These functions should only be used by Python internals.
* gh-91755: Document Py_IncRef and Py_DecRef as C functions (#91805)Charlie Zhao2022-05-181-4/+10
| | | | Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Document Py_ssize_t. (GH-92512)Julien Palard2022-05-138-22/+29
| | | | | | It fixes 252 errors from a Sphinx nitpicky run (sphinx-build -n). But there's 8182 errors left. Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
* gh-92536: Doc update about Py_UNICODE removal (GH-92756)Inada Naoki2022-05-132-3/+3
|
* gh-92536: PEP 623: Remove wstr and legacy APIs from Unicode (GH-92537)Inada Naoki2022-05-122-198/+26
|
* gh-89653: PEP 670: Fix Sphinx syntax in Unicode doc (#92707)Victor Stinner2022-05-121-4/+4
|
* gh-89653: PEP 670: unicodeobject.h uses _Py_CAST() (#92696)Victor Stinner2022-05-111-3/+3
| | | | | | | | | | Use _Py_CAST() and _Py_STATIC_CAST() in macros wrapping static inline functions of unicodeobject.h. Change also the kind type from unsigned int to int: same parameter type than PyUnicode_FromKindAndData(). The limited API version 3.11 no longer casts arguments to expected types.
* gh-89653: PEP 670: Update C API unicode documentation (#92702)Victor Stinner2022-05-111-10/+11
|
* Enhance PyConfig documentation (#92394)Victor Stinner2022-05-091-37/+46
|
* GH-92431: Fix footnotes in Doc/c-api/exceptions.rst (GH-92432)Hugo van Kemenade2022-05-081-11/+11
| | | | | * Remove redundant footnote ref: the footnote has been removed * Fix footnote ref to match footnote * Convert footnotes into reST footnotes: will error if missing
* Document the lifetime of `PyUnicode_AsUTF8String` (#92325)Matt Wozniski2022-05-061-1/+2
| | | The current wording implied this, but didn't state it explicitly.
* gh-88279: Deprecate PySys_SetArgvEx() (#92363)Victor Stinner2022-05-063-5/+23
| | | | | | | Deprecate the following C functions: * PySys_SetArgv() * PySys_SetArgvEx() * PySys_SetPath()
* gh-57684: Add -P cmdline option and PYTHONSAFEPATH env var (#31542)Victor Stinner2022-05-051-9/+37
| | | | | | | | | | | | Add the -P command line option and the PYTHONSAFEPATH environment variable to not prepend a potentially unsafe path to sys.path. * Add sys.flags.safe_path flag. * Add PyConfig.safe_path member. * Programs/_bootstrap_python.c uses config.safe_path=0. * Update subprocess._optim_args_from_interpreter_flags() to handle the -P command line option. * Modules/getpath.py sets safe_path to 1 if a "._pth" file is present.
* gh-92047: Py_GetVersion multi-digit minor version (GH-92047) (#92048)Robert Howlett2022-05-051-1/+1
|
* gh-89653: PEP 670: Convert PyBytes macros to functions (#91990)Victor Stinner2022-05-032-4/+4
| | | | | | | | | | | | Convert the following macros to static inline functions: * PyByteArray_AS_STRING() * PyByteArray_GET_SIZE() * PyBytes_AS_STRING() * PyBytes_GET_SIZE() Limited C API version 3.11 no longer casts arguments. Add _PyBytes_CAST() and _PyByteArray_CAST() macros.
* gh-92154: Expose PyCode_GetCode in the C API (GH-92168)Ken Jin2022-05-031-0/+14
|
* gh-88097: doc: fix link to Py_Version (#92141)Victor Stinner2022-05-021-1/+1
|
* gh-89653: PEP 670: Amend docs (GH-91813)Erlend Egeberg Aasland2022-04-224-17/+18
|
* 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
|