summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* gh-96143: Allow Linux perf profiler to see Python calls (GH-96123)Pablo Galindo Salgado2022-08-301-0/+14
| | | | | | | :warning: :warning: Note for reviewers, hackers and fellow systems/low-level/compiler engineers :warning: :warning: If you have a lot of experience with this kind of shenanigans and want to improve the **first** version, **please make a PR against my branch** or **reach out by email** or **suggest code changes directly on GitHub**. If you have any **refinements or optimizations** please, wait until the first version is merged before starting hacking or proposing those so we can keep this PR productive.
* GH-95245: Document use of `MANAGED` flags instead of offsets. (GH-96044)Mark Shannon2022-08-303-55/+69
|
* Doc: Update Py_TPFLAGS_HAVE_FINALIZE in docs (GH-96273)da-woods2022-08-301-3/+6
| | | It is now deprecated and the docs should reflect that.
* Clarify API stability of PyTypeObject in relation to static types. (GH-96217)ov2k2022-08-251-3/+3
| | | | | | | Fixes: https://github.com/python/cpython/issues/95300 Related: https://github.com/python/cpython/issues/91271
* GH-93503: Add thread-specific APIs to set profiling and tracing functions in ↵Pablo Galindo Salgado2022-08-241-0/+24
| | | | | | | | | | | | | | | | | the C-API (#93504) * gh-93503: Add APIs to set profiling and tracing functions in all threads in the C-API * Use a separate API * Fix NEWS entry * Add locks around the loop * Document ignoring exceptions * Use the new APIs in the sys module * Update docs
* gh-93103: Doc uses PyConfig rather than deprecated vars (#96070)Victor Stinner2022-08-183-5/+5
| | | | The C API documentation now uses the new PyConfig API, rather than deprecated global configuration variables.
* GH-92678: Document that you shouldn't be doing your own dictionary offset ↵Mark Shannon2022-08-092-12/+23
| | | | | | calculations. (GH-95598) Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
* gh-95781: More strict format string checking in PyUnicode_FromFormatV() ↵Serhiy Storchaka2022-08-081-3/+5
| | | | | | | | | (GH-95784) An unrecognized format character in PyUnicode_FromFormat() and PyUnicode_FromFormatV() now sets a SystemError. In previous versions it caused all the rest of the format string to be copied as-is to the result string, and any extra arguments discarded.
* gh-94673: Add Per-Interpreter tp_subclasses for Static Builtin Types (gh-95301)Eric Snow2022-08-051-3/+11
|
* gh-93274: Make vectorcall safe on mutable classes & inherit it by default ↵Petr Viktorin2022-08-042-14/+29
| | | | (#95437)
* gh-94936: C getters: co_varnames, co_cellvars, co_freevars (#95008)Ken Jin2022-08-041-0/+25
|
* gh-94673: Add Per-Interpreter tp_weaklist for Static Builtin Types (#95302)Eric Snow2022-07-291-0/+7
| | | | | | | | | | | | | | | * Store tp_weaklist on the interpreter state for static builtin types. * Factor out _PyStaticType_GET_WEAKREFS_LISTPTR(). * Add _PyStaticType_ClearWeakRefs(). * Add a comment about how _PyStaticType_ClearWeakRefs() loops. * Document the change. * Update Doc/whatsnew/3.12.rst * Fix a typo.
* Fix Unicode doc and replace use of macro with PyMem_New function (GH-94088)Pamela Fox2022-07-281-1/+1
|
* gh-59200: Clarify `PyLong_FromString` documentation (GH-94363)JustAnotherArchivist2022-07-281-8/+9
|
* gh-90359: Unify documentation style for datetime.rst (gh-94836)Dong-hee Na2022-07-141-0/+7
|
* gh-90359: Update documentation to follow PEP 495. (gh-94800)Dong-hee Na2022-07-141-0/+12
|
* Docs: remove redundant "adverb-adjective" hyphens from compound modifiers ↵Ned Batchelder2022-07-055-6/+6
| | | | | (GH-94551) Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021
* [doc] fix typo in reference to tp_descr_get and tp_descr_set (GH-94140)Max Bachmann2022-06-261-2/+2
|
* gh-77782: Py_FdIsInteractive() now uses PyConfig.interactive (#93916)Victor Stinner2022-06-171-1/+3
|
* gh-93466: Document PyType_Spec doesn't accept repeated slot IDs; raise where ↵Petr Viktorin2022-06-101-0/+2
| | | | this was problematic (GH-93471)
* bpo-45383: Get metaclass from bases in PyType_From* (GH-28748)Sebastian Berg2022-06-091-3/+33
| | | | | | | | | This checks the bases of of a type created using the FromSpec API to inherit the bases metaclasses. The metaclass's alloc function will be called as is done in `tp_new` for classes created in Python. Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
* Doc: Update references and examples of old, unsupported OSes and uarches ↵CAM Gerlach2022-06-091-3/+2
| | | | (GH-92791)
* gh-87961: Remove outdated notes from functions that aren't in the Limited ↵Petr Viktorin2022-06-083-26/+0
| | | | | | | | | | | | API (GH-93581) * Remove outdated notes from functions that aren't in the Limited API Nowadays everything that *is* in the Limited API has a note added automatically. These notes could mislead people to think that these functions could never be added to the limited API. Remove them. * Also remove forgotten note on tp_vectorcall_offset not being finalized
* gh-60074: add new stable API function PyType_FromMetaclass (GH-93012)Wenzel Jakob2022-05-272-5/+17
| | | | | | | | Added a new stable API function ``PyType_FromMetaclass``, which mirrors the behavior of ``PyType_FromModuleAndSpec`` except that it takes an additional metaclass argument. This is, e.g., useful for language binding tools that need to store additional information in the type object.
* gh-93202: Always use %zd printf formatter (#93201)Victor Stinner2022-05-252-7/+0
| | | | | | | | | | | | | | | | Python now always use the ``%zu`` and ``%zd`` printf formats to format a size_t or Py_ssize_t number. Building Python 3.12 requires a C11 compiler, so these printf formats are now always supported. * PyObject_Print() and _PyObject_Dump() now use the printf %zd format to display an object reference count. * Update PY_FORMAT_SIZE_T comment. * Remove outdated notes about the %zd format in PyBytes_FromFormat() and PyUnicode_FromFormat() documentations. * configure no longer checks for the %zd format and no longer defines PY_FORMAT_SIZE_T macro in pyconfig.h. * pymacconfig.h no longer undefines PY_FORMAT_SIZE_T: macOS 10.4 is no longer supported. Python 3.12 now requires macOS 10.6 (Snow Leopard) or newer.
* gh-93103: Enhance PyConfig.parser_debug documentation (#93186)Victor Stinner2022-05-241-0/+3
| | | | Document that -d option and PYTHONDEBUG env var require a debug build of Python. Also mention them in the debug build documentation.
* gh-92913: Fix typos in documentation (GH-93129)Steve Dower2022-05-231-3/+3
|
* 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.