summaryrefslogtreecommitdiff
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag (GH-25520)Erlend Egeberg Aasland2021-04-281-0/+12
| | | | | | Introduce Py_TPFLAGS_IMMUTABLETYPE flag for immutable type objects, and modify PyType_Ready() to set it for static types. Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-28254: Add a C-API for controlling the GC state (GH-25687)scoder2021-04-281-0/+43
| | | | | | | | Add new C-API functions to control the state of the garbage collector: PyGC_Enable(), PyGC_Disable(), PyGC_IsEnabled(), corresponding to the functions in the gc module. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671)scoder2021-04-281-7/+6
| | | Automerge-Triggered-By: GH:scoder
* Fix typo in exceptions.rst (GH-25434)Ikko Ashimine2021-04-171-1/+1
| | | attemps -> attempts
* bpo-43862: Enhance -W cmdline option documentation (GH-25439)Victor Stinner2021-04-161-0/+7
| | | | | The -W format is "action:message:category:module:lineno". Update also the Python manual page.
* bpo-43774: Add more links to configure options (GH-25363)Victor Stinner2021-04-121-4/+4
|
* Fix Sphinx errors in the documentation and re-activate the suspicious check ↵Pablo Galindo2021-04-121-1/+1
| | | | | | | (GH-25368) The suspicious check is still executed as part of the release process and release managers have been lately fixing some actual errors that the suspicious target can find. For this reason, reactivate the suspicious until we decide what to do in a coordinated fashion.
* bpo-43753: Add Py_Is() and Py_IsNone() functions (GH-25227)Victor Stinner2021-04-111-0/+31
| | | | | | | Add the Py_Is(x, y) function to test if the 'x' object is the 'y' object, the same as "x is y" in Python. Add also the Py_IsNone(), Py_IsTrue(), Py_IsFalse() functions to test if an object is, respectively, the None singleton, the True singleton or the False singleton.
* bpo-43774: Document configure options (GH-25283)Victor Stinner2021-04-083-17/+24
| | | | | | Add Doc/using/configure.rst documentation to document configure, preprocessor, compiler and linker options. Add a new section about the "Python debug build".
* Document PyCode_Addr2Line function. (GH-25111)Mark Shannon2021-04-021-0/+8
| | | | | * Document PyCode_Addr2Line function. * Clarify when to use PEP 626 line iterators.
* bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481)Inada Naoki2021-03-291-0/+9
| | | | | | | | | | | See [PEP 597](https://www.python.org/dev/peps/pep-0597/). * Add `-X warn_default_encoding` and `PYTHONWARNDEFAULTENCODING`. * Add EncodingWarning * Add io.text_encoding() * open(), TextIOWrapper() emits EncodingWarning when encoding is omitted and warn_default_encoding is enabled. * _pyio.TextIOWrapper() uses UTF-8 as fallback default encoding used when failed to import locale module. (used during building Python) * bz2, configparser, gzip, lzma, pathlib, tempfile modules use io.text_encoding(). * What's new entry
* bpo-31861: Complete the C-API docs for PyObject_GetAiter and PyAiter_Check ↵Pablo Galindo2021-03-232-0/+17
| | | | (GH-25004)
* bpo-43422: Revert _decimal C API addition (GH-24960)Antoine Pitrou2021-03-212-232/+0
| | | | | | | | | Stefan Krah requested the reversal of these (unreleased) changes, quoting him: > The capsule API does not meet my testing standards, since I've focused on the upstream mpdecimal in the last couple of months. > Additionally, I'd like to refine the API, perhaps together with the Arrow community. Automerge-Triggered-By: GH:pitrou
* bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885)Inada Naoki2021-03-161-11/+15
| | | See PEP 624.
* bpo-43356: Allow passing a signal number to interrupt_main() (GH-24755)Antoine Pitrou2021-03-111-13/+57
| | | | Also introduce a new C API ``PyErr_SetInterruptEx(int signum)``.
* bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795)Victor Stinner2021-03-091-1/+1
|
* bpo-36346: Document removal schedule of deprecate APIs (GH-20879)Inada Naoki2021-02-232-8/+7
| | | We will remove wstr cache in Python 3.12. See PEP 623.
* bpo-43277: Add PySet_CheckExact to the C-API (GH-24598)Pablo Galindo2021-02-201-0/+6
| | | For some mysterious reason we have PySet_Check, PyFrozenSet_Check, PyAnySet_Check, PyAnySet_CheckExact and PyFrozenSet_CheckExact but no PySet_CheckExact.
* closes bpo-43266: Improve array formatting. (GH-24573)Erlend Egeberg Aasland2021-02-191-4/+4
|
* closes bpo-43254: Fix *snprintf() man page refs. (GH-24563)Erlend Egeberg Aasland2021-02-181-2/+2
|
* bpo-42990: Refactor _PyFrame_New_NoTrack() (GH-24566)Victor Stinner2021-02-181-3/+5
| | | | | | | | | | | | * Refactor _PyFrame_New_NoTrack() and PyFunction_NewWithQualName() code. * PyFrame_New() checks for _PyEval_BuiltinsFromGlobals() failure. * Fix a ref leak in _PyEval_BuiltinsFromGlobals() error path. * Complete PyFunction_GetModule() documentation: it returns a borrowed reference and it can return NULL. * Move _PyEval_BuiltinsFromGlobals() definition to the internal C API. * PyFunction_NewWithQualName() uses _Py_IDENTIFIER() API for the "__name__" string to make it compatible with subinterpreters.
* bpo-40170: Always define PyIter_Check() as a function (GH-24548)Erlend Egeberg Aasland2021-02-161-2/+2
|
* bpo-40170: Convert PyDescr_IsData() to static inline function (GH-24535)Erlend Egeberg Aasland2021-02-161-2/+2
|
* bpo-43181: Convert PyObject_TypeCheck to static inline function (GH-24533)Erlend Egeberg Aasland2021-02-151-2/+2
|
* Fix Sphynx syntax in the memory.rst documentv3.10.0a5Pablo Galindo2021-02-021-1/+1
|
* Add a clarification for the object-domain allocators regarding pointer ↵Pablo Galindo2021-01-191-0/+7
| | | | validity (GH-24253)
* Add a paragraph about allocation domains to the C-API docs (GH-24252)Pablo Galindo2021-01-181-1/+32
|
* Docs: Remove stray semicolon in init.rst (GH-23974)Ken Jin2021-01-141-1/+1
| | | Removed stray semicolon which was causing the docs to render weirdly (it's the function right under the one [here](https://docs.python.org/3/c-api/init.html#c._PyInterpreterState_GetEvalFrameFunc)).
* bpo-42528: Improve the docs of most Py*_Check{,Exact} API calls (GH-23602)Antonio Cuni2021-01-0626-52/+74
| | | | | I think that none of these API calls can fail, but only few of them are documented as such. Add the sentence "This function always succeeds" (which is the same already used e.g. by PyNumber_Check) to all of them.
* bpo-42451: Indicate that PyTuple_GetItem does not support negative indices ↵Yasser A2020-11-301-1/+1
| | | | (GH-23529)
* bpo-42423: Accept single base class in PyType_FromModuleAndSpec() (GH-23441)Serhiy Storchaka2020-11-221-4/+4
|
* bpo-42412: Fix possible leaks and check arguments in ↵Serhiy Storchaka2020-11-211-2/+4
| | | | | | | | PyType_FromModuleAndSpec() (GH-23410) * There were leaks if Py_tp_bases is used more than once or if some call is failed before setting tp_bases. * There was a crash if the bases argument or the Py_tp_bases slot is not a tuple. * The documentation was not accurate.
* bpo-42085: Add documentation for Py_TPFLAGS_HAVE_AM_SEND (GH-23374)Vladimir Matveev2020-11-181-0/+8
| | | | | Updated docs to include `Py_TPFLAGS_HAVE_AM_SEND`. News section should not be necessary. Automerge-Triggered-By: GH:asvetlov
* bpo-39573: Convert Py_TYPE() and Py_SIZE() back to macros (GH-23366)Victor Stinner2020-11-181-6/+2
| | | | | | | | | This change partically reverts commit ad3252bad905d41635bcbb4b76db30d570cf0087 and the commit fe2978b3b940fe2478335e3a2ca5ad22338cdf9c. Many third party C extension modules rely on the ability of using Py_TYPE() to set an object type: "Py_TYPE(obj) = type;" or to set an object type using: "Py_SIZE(obj) = size;".
* bpo-41832: Restore note about NULL in PyType_Slot.pfunc (GH-23243)Hai Shi2020-11-141-0/+2
|
* bpo-42294: Grammar fixes in doc glossary strong/weak refs (GH-23227)kj2020-11-111-1/+1
|
* bpo-41073: PyType_GetSlot() can now accept static types. (GH-21931)Hai Shi2020-11-101-2/+4
| | | | | | | PyType_GetSlot() can now accept static types. Co-Authored-By: Petr Viktorin <encukou@gmail.com> Automerge-Triggered-By: GH:encukou
* bpo-42260: Fix _PyConfig_Read() if compute_path_config=0 (GH-23220)Victor Stinner2020-11-102-17/+57
| | | | | | | | | | | | | | | | | | | Fix _PyConfig_Read() if compute_path_config=0: use values set by Py_SetPath(), Py_SetPythonHome() and Py_SetProgramName(). Add compute_path_config parameter to _PyConfig_InitPathConfig(). The following functions now return NULL if called before Py_Initialize(): * Py_GetExecPrefix() * Py_GetPath() * Py_GetPrefix() * Py_GetProgramFullPath() * Py_GetProgramName() * Py_GetPythonHome() These functions no longer automatically computes the Python Path Configuration. Moreover, Py_SetPath() no longer computes program_full_path.
* bpo-42085: Introduce dedicated entry in PyAsyncMethods for sending values ↵Vladimir Matveev2020-11-101-0/+16
| | | | (#22780)
* bpo-42171: Add PEP573-related items to the limited API (GH-23009)Petr Viktorin2020-11-101-2/+4
|
* bpo-42294: Add borrowed/strong reference to doc glossary (GH-23206)Victor Stinner2020-11-098-20/+39
| | | | | | Add "borrowed reference" and "strong reference" to the documentation glossary. Enhance also Py_INCREF() and Py_NewRef() documentation.
* bpo-41832: PyType_FromModuleAndSpec() now accepts NULL tp_doc (GH-23123)Hai Shi2020-11-061-2/+4
|
* bpo-42260: PyConfig_Read() only parses argv once (GH-23168)Victor Stinner2020-11-051-92/+104
| | | | | | | | | | | | The PyConfig_Read() function now only parses PyConfig.argv arguments once: PyConfig.parse_argv is set to 2 after arguments are parsed. Since Python arguments are strippped from PyConfig.argv, parsing arguments twice would parse the application options as Python options. * Rework the PyConfig documentation. * Fix _testinternalcapi.set_config() error handling. * SetConfigTests no longer needs parse_argv=0 when restoring the old configuration.
* bpo-42262: Add Py_NewRef() and Py_XNewRef() (GH-23152)Victor Stinner2020-11-051-0/+31
| | | | Added Py_NewRef() and Py_XNewRef() functions to increment the reference count of an object and return the object.
* bpo-42260: Add _PyInterpreterState_SetConfig() (GH-23158)Victor Stinner2020-11-051-0/+2
| | | | | | | | * Inline _PyInterpreterState_SetConfig(): replace it with _PyConfig_Copy(). * Add _PyErr_SetFromPyStatus() * Add _PyInterpreterState_GetConfigCopy() * Add a new _PyInterpreterState_SetConfig() function. * Add an unit which gets, modifies, and sets the config.
* bpo-1635741: Add PyModule_AddObjectRef() function (GH-23122)Victor Stinner2020-11-041-14/+90
| | | | | Added PyModule_AddObjectRef() function: similar to PyModule_AddObjectRef() but don't steal a reference to the value on success.
* bpo-42236: Enhance init and encoding documentation (GH-23109)Victor Stinner2020-11-026-183/+521
| | | | | | | | | | | | | | | | | | | | | Enhance the documentation of the Python startup, filesystem encoding and error handling, locale encoding. Add a new "Python UTF-8 Mode" section. * Add "locale encoding" and "filesystem encoding and error handler" to the glossary * Remove documentation from Include/cpython/initconfig.h: move it to Doc/c-api/init_config.rst. * Doc/c-api/init_config.rst: * Document command line options and environment variables * Document default values. * Add a new "Python UTF-8 Mode" section in Doc/library/os.rst. * Add warnings to Py_DecodeLocale() and Py_EncodeLocale() docs. * Document how Python selects the filesystem encoding and error handler at a single place: PyConfig.filesystem_encoding and PyConfig.filesystem_errors. * PyConfig: move orig_argv member at the right place.
* bpo-42236: Use UTF-8 encoding if nl_langinfo(CODESET) fails (GH-23086)Victor Stinner2020-11-011-5/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the nl_langinfo(CODESET) function returns an empty string, Python now uses UTF-8 as the filesystem encoding. In May 2010 (commit b744ba1d14c5487576c95d0311e357b707600b47), I modified Python to log a warning and use UTF-8 as the filesystem encoding (instead of None) if nl_langinfo(CODESET) returns an empty string. In August 2020 (commit 94908bbc1503df830d1d615e7b57744ae1b41079), I modified Python startup to fail with a fatal error and a specific error message if nl_langinfo(CODESET) returns an empty string. The intent was to prevent guessing the encoding and also investigate user configuration where this case happens. In 10 years (2010 to 2020), I saw zero user report about the error message related to nl_langinfo(CODESET) returning an empty string. Today, UTF-8 became the defacto standard and it's safe to make the assumption that the user expects UTF-8. For example, nl_langinfo(CODESET) can return an empty string on macOS if the LC_CTYPE locale is not supported, and UTF-8 is the default encoding on macOS. While this change is likely to not affect anyone in practice, it should make UTF-8 lover happy ;-) Rewrite also the documentation explaining how Python selects the filesystem encoding and error handler.
* bpo-41192: Add documentation of undocumented audit events (GH-21308)Saiyang Gou2020-10-201-0/+2
|
* bpo-41784: make PyUnicode_AsUTF8AndSize part of the limited API (GH-22252)Alex Gaynor2020-10-191-0/+3
|