summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* bpo-39573: Py_TYPE becomes a static inline function (GH-28128)Victor Stinner2021-09-081-3/+10
| | | | | Convert the Py_TYPE() and Py_SIZE() macros to static inline functions. The Py_SET_TYPE() and Py_SET_SIZE() functions must now be used to set an object type and size.
* bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194)Yury Selivanov2021-09-072-2/+2
| | | | | | | | Fix PyAiter_Check to only check for the `__anext__` presense (not for `__aiter__`). Rename `PyAiter_Check()` to `PyAIter_Check()`, `PyObject_GetAiter()` -> `PyObject_GetAIter()`. Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-45094: Add Py_NO_INLINE macro (GH-28140)Victor Stinner2021-09-031-43/+56
| | | | | * Rename _Py_NO_INLINE macro to Py_NO_INLINE: make it public and document it. * Sort macros in the C API documentation.
* bpo-45019: Add a tool to generate list of modules to include for frozen ↵Eric Snow2021-08-301-1/+1
| | | | | | | modules (gh-27980) Frozen modules must be added to several files in order to work properly. Before this change this had to be done manually. Here we add a tool to generate the relevant lines in those files instead. This helps us avoid mistakes and omissions. https://bugs.python.org/issue45019
* [doc] Fix typo c-api/exceptions.rst (GH-27847)Sunny Bean2021-08-231-1/+1
| | | Co-authored-by: Tianqing Peng <pengtianqing@yimian.com.cn>
* bpo-42035: Add PyType_GetQualName() to get a type's qualified name. (GH-27551)Hai Shi2021-08-171-0/+7
|
* Note that tp_clear and m_clear are not always called (GH-27581)Petr Viktorin2021-08-042-0/+12
|
* bpo-41886: Fix documented type of PyType_Type (GH-22454)da-woods2021-08-031-1/+1
|
* Document PyMember_GetOne and PyMember_SetOne (GH-27555)Ken Jin2021-08-021-0/+15
|
* bpo-41103: Resurrect the old buffer protocol. (GH-27437)Inada Naoki2021-07-292-0/+56
| | | | | Revert "bpo-41103: Remove old buffer protocol support (#21117)" This reverts commit 6f8a6ee59cb7f99f68df8ee9c3e8c8cf19af3eed.
* bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724)Ammar Askar2021-07-291-1/+1
|
* bpo-42035: Add a PyType_GetName() to get type's short name. (GH-23903)Hai Shi2021-07-291-0/+6
|
* bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make ↵Petr Viktorin2021-07-231-10/+1
| | | | | | | | | | | | Py_TPFLAGS_HAVE_VERSION_TAG no-op (GH-27260) * Remove code that checks Py_TPFLAGS_HAVE_VERSION_TAG The field is always present in the type struct, as explained in the added comment. * Remove Py_TPFLAGS_HAVE_AM_SEND The flag is not needed, and since it was added in 3.10 it can be removed now.
* bpo-43950: Add documentation for PEP-657 (GH-27047)Ammar Askar2021-07-131-0/+8
| | | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-43908: Immutable types inherit vectorcall (GH-27001)Erlend Egeberg Aasland2021-07-081-8/+9
| | | | | | Heap types with the Py_TPFLAGS_IMMUTABLETYPE flag can now inherit the PEP 590 vectorcall protocol. Previously, this was only possible for static types. Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-43950: Add option to opt-out of PEP-657 (GH-27023)Ammar Askar2021-07-071-0/+10
| | | | | Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com> Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)Gabriele N. Tornetta2021-07-071-3/+4
|
* Fix a small typo in the docs (GH-26991)Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి)2021-07-031-1/+1
|
* bpo-40939: Remove documentation for `PyParser_*` & add porting notes (GH-26855)Petr Viktorin2021-06-241-36/+0
| | | | | | I tried to be relatively thorough and give lots of links. One reason is that this wasn't deprecated very long; also it seems people running into this tend to not be familiar with similar APIs. Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874)Victor Stinner2021-06-232-2/+9
| | | | | Py_RunMain() now resets PyImport_Inittab to its initial value at exit. It must be possible to call PyImport_AppendInittab() or PyImport_ExtendInittab() at each Python initialization.
* bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798)Mark Dickinson2021-06-191-2/+2
|
* bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it ↵Mark Dickinson2021-06-161-2/+2
| | | | to 'num'. (GH-26744)
* bpo-44392: Add Py_GenericAlias to C API docs (GH-26724)Ken Jin2021-06-162-0/+48
| | | | Also fix stable ABI type definitions
* bpo-44348: Revert "bpo-39573: Py_TYPE becomes a static inline function ↵Pablo Galindo2021-06-081-10/+3
| | | | | | (GH-26493)" (GH-26596) This reverts commit f3fa63ec75fdbb4a08a10957a5c631bf0c4a5970 as is causing crashes in some Windows tests in the buildbots.
* bpo-39573: Py_TYPE becomes a static inline function (GH-26493)Victor Stinner2021-06-031-3/+10
| | | | | Convert the Py_TYPE() and Py_SIZE() macros to static inline functions. The Py_SET_TYPE() and Py_SET_SIZE() functions must now be used to set an object type and size.
* bpo-39560: Document PyUnicode_FromKindAndData() kind transformation (GH-23848)Zackery Spytz2021-06-031-0/+6
|
* bpo-42085: [docs] Add versionadded for am_send in type object documentation ↵Martmists2021-05-291-0/+2
| | | | (GH-25465)
* bpo-44263: Mention PyType_Ready in the gc protocol warning (GH-26445)Pablo Galindo2021-05-292-9/+12
|
* bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases ↵Pablo Galindo2021-05-292-0/+18
| | | | (GH-26442)
* Reword paragraph on specific value for Py_LIMITED_API (GH-26101)Petr Viktorin2021-05-141-12/+12
|
* bpo-44113: Deprecate old functions to config Python init (GH-26060)Victor Stinner2021-05-123-0/+52
| | | | | | | | | | | | | | | | | Deprecate the following functions to configure the Python initialization: * PySys_AddWarnOption() * PySys_AddWarnOptionUnicode() * PySys_AddXOption() * PySys_HasWarnOptions() * Py_SetPath() * Py_SetProgramName() * Py_SetPythonHome() * Py_SetStandardStreamEncoding() * _Py_SetProgramFullPath() Use the new PyConfig API of the Python Initialization Configuration instead (PEP 587).
* bpo-43795: PEP 652 user documentation (GH-25668)Petr Viktorin2021-05-112-62/+205
| | | | | | - Reformat the C API and ABI Versioning page (and extend/clarify a bit) - Rewrite the stable ABI docs into a general text on C API Compatibility - Add a list of Limited API contents, and notes for the individual items. - Replace `Include/README.rst` with a link to a devguide page with the same info
* bpo-44029: Remove Py_UNICODE APIs (GH-25881)Inada Naoki2021-05-072-206/+0
| | | | | | | | | | | | Remove deprecated `Py_UNICODE` APIs: `PyUnicode_Encode`, `PyUnicode_EncodeUTF7`, `PyUnicode_EncodeUTF8`, `PyUnicode_EncodeUTF16`, `PyUnicode_EncodeUTF32`, `PyUnicode_EncodeLatin1`, `PyUnicode_EncodeMBCS`, `PyUnicode_EncodeDecimal`, `PyUnicode_EncodeRawUnicodeEscape`, `PyUnicode_EncodeCharmap`, `PyUnicode_EncodeUnicodeEscape`, `PyUnicode_TransformDecimalToASCII`, `PyUnicode_TranslateCharmap`, `PyUnicodeEncodeError_Create`, `PyUnicodeTranslateError_Create`. See :pep:`393` and :pep:`624` for reference.
* bpo-43977: Document the new pattern matching type flags (GH-25734)Brandt Bucher2021-05-021-0/+44
|
* bpo-43928: Fix 'succesfully' typo in document (GH-25569)JT2021-04-301-1/+1
|
* bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721)Victor Stinner2021-04-301-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new Py_TPFLAGS_DISALLOW_INSTANTIATION type flag to disallow creating type instances: set tp_new to NULL and don't create the "__new__" key in the type dictionary. The flag is set automatically on static types if tp_base is NULL or &PyBaseObject_Type and tp_new is NULL. Use the flag on the following types: * _curses.ncurses_version type * _curses_panel.panel * _tkinter.Tcl_Obj * _tkinter.tkapp * _tkinter.tktimertoken * _xxsubinterpretersmodule.ChannelID * sys.flags type * sys.getwindowsversion() type * sys.version_info type Update MyStr example in the C API documentation to use Py_TPFLAGS_DISALLOW_INSTANTIATION. Add _PyStructSequence_InitType() function to create a structseq type with the Py_TPFLAGS_DISALLOW_INSTANTIATION flag set. type_new() calls _PyType_CheckConsistency() at exit.
* bpo-43774: Enhance debug build documentation (GH-25712)Victor Stinner2021-04-292-48/+27
| | | | | * Add also references to --with-trace-refs option. * Move _ob_next and _ob_prev at the end, since they don't exist by default and are related to debug.
* bpo-43774: Remove unused PYMALLOC_DEBUG macro (GH-25711)Victor Stinner2021-04-292-46/+122
| | | Enhance also the documentation of debug hooks on memory allocators.
* bpo-43908: Document Static Types in the C API (GH-25710)Victor Stinner2021-04-292-43/+60
| | | Update also PyTypeObject structure definition in the doc.
* 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-101-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