summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* Fixed an incorrect sentence in the docs (GH-17205)Miss Islington (bot)2019-11-211-2/+1
| | | | | | | | | | | Fixed an incorrect sentence in Doc/c-api/mapping.rst I fell on while translating the file. skip issue Automerge-Triggered-By: @csabella (cherry picked from commit 06ca2a2be9374ac390e9407685ccce941ab9ffa2) Co-authored-by: Aveheuzed <a.masson555@ntymail.com>
* [3.7] bpo-38159: Clarify documentation of PyState_AddModule (GH-16101) ↵Miss Islington (bot)2019-11-051-0/+11
| | | | | | | | | | | | | | | | | | (GH-17027) This was never intented to be called manually from PyInit_*. Also, clarify PyState_RemoveModule return value. (cherry picked from commit 9bc94eca0c69a551f928692364a99e9b67c4a45b) Co-authored-by: Petr Viktorin <encukou@gmail.com> https://bugs.python.org/issue38159 Automerge-Triggered-By: @encukou
* [3.7] bpo-38600: NULL -> ``NULL``. (GH-17001) (GH-17004)Serhiy Storchaka2019-10-3015-47/+47
| | | | | Also fix some other formatting. (cherry picked from commit e835b31d2b212c3c7820364398979cae2a9740b2)
* [3.7] bpo-38600: Change the mark up of NULL in the C API documentation. ↵Serhiy Storchaka2019-10-3046-635/+635
| | | | | | | (GH-16950) (GH-17000) Replace all *NULL* with ``NULL``. (cherry picked from commit 25fc088607c855060ed142296dc1bd0125fad1af)
* bpo-38557: Improve documentation for list and tuple C API. (GH-16925)Miss Skeleton (bot)2019-10-262-12/+18
| | | | | (cherry picked from commit d898d20e8c228229eb68e545f544db13f246f216) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Emphasize the need to always call PySequence_Fast. (GH-11140)Miss Islington (bot)2019-09-121-7/+14
| | | | | (cherry picked from commit 57b7dbc46e71269d855e644d30826d33eedee2a1) Co-authored-by: Matti Picus <matti.picus@gmail.com>
* bpo-26868: Fix example usage of PyModule_AddObject. (GH-15725)Miss Islington (bot)2019-09-121-1/+16
| | | | | | | | | | | | | | | | | | * Add a note to the PyModule_AddObject docs. * Correct example usages of PyModule_AddObject. * Whitespace. * Clean up wording. * 📜🤖 Added by blurb_it. * First code review. * Add < 0 in the tests with PyModule_AddObject (cherry picked from commit 224b8aaa7e8f67f748e8b7b6a4a77a25f6554651) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992) (GH-15998)Miss Islington (bot)2019-09-111-2/+2
| | | | | | https://bugs.python.org/issue37698 (cherry picked from commit 15f5a7527b87e11fcf23069c147fd4cb7d42cfb0) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988) (GH-15991)Miss Islington (bot)2019-09-111-0/+7
| | | | | | | | https://bugs.python.org/issue37750 Automerge-Triggered-By: @matrixise (cherry picked from commit 5a56ce4a0e820fefcd598b94715a7ff7e199858d) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* Docs: Small tweaks to c-api/introGH-Include_Files (GH-14698)Miss Islington (bot)2019-09-101-7/+9
| | | | | (cherry picked from commit b6dafe51399f5c6313a00529118a6052b466942f) Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-34101: Add doc of PyBuffer_GetPointer (GH-14994) (GH-15055)Miss Islington (bot)2019-07-311-0/+6
| | | | | (cherry picked from commit 1b29af83bc17e773b0c0d117f5fe1018fde46b0d) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* Docs: Correct formatting of a multiline code block (GH-13806)Miss Islington (bot)2019-07-171-2/+4
| | | | | (cherry picked from commit bd26a4466b507e196fc9a5e4a6cb7cd6d39f85aa) Co-authored-by: Joseph Fox-Rabinovitz <madphysicist@users.noreply.github.com>
* bpo-37487: Fix PyList_GetItem index description. (GH-14623) (GH-14625)Miss Islington (bot)2019-07-061-3/+3
| | | | | | 0 is a legal index. (cherry picked from commit f8709e804d16ec5d44b1d2f00d59a0f78df7b792) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* closes bpo-37508: Fix name of type in memory.rst. (GH-14604)Miss Islington (bot)2019-07-061-1/+1
| | | | | (cherry picked from commit 39a5d17a7f1387582eb484422df450bc09a5543e) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* bpo-37441: Fix wrong PyErr_SetImportErrorSubclass signature in doc (GH-14453)Miss Islington (bot)2019-07-031-1/+1
| | | | | (cherry picked from commit aeecf380660ea459d85bb5f59d76bb54f757b5be) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* bpo-37432: Doc: Fix signature of PyObject_Del() (GH-14430)Miss Islington (bot)2019-06-281-1/+1
| | | | | (cherry picked from commit b4bee03087a3c70cb040e2ce569c828860ed8e87) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* bpo-37194: Complete PyObject_CallXXX() docs (GH-14156) (GH-14158)Victor Stinner2019-06-171-6/+13
| | | | | | Mention explicitly that PyObject_CallXXX() functions raise an exception an failure. (cherry picked from commit 1ce2656f13e726b3b99d4c968926908cff1f460a)
* bpo-28805: document METH_FASTCALL (GH-14079)Miss Islington (bot)2019-06-161-12/+51
| | | | | (cherry picked from commit 5600b5e1b24a3491e83f1b3038a7ea047a34c0bf) Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be>
* [3.7] bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() ↵Zackery Spytz2019-06-071-2/+4
| | | | | | | (GH-13860) (GH-13896) (cherry picked from commit dc2476500d91082f0c907772c83a044bf49af279) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not ↵Miss Islington (bot)2019-05-241-6/+6
| | | | | | | | handled (GH-7778) ``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python. (cherry picked from commit 608876b6b1eb59538e6c29671a733033fb8b5be7) Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
* bpo-36829: Enhance PyErr_WriteUnraisable() (GH-13487)Victor Stinner2019-05-221-0/+2
| | | | | | | | | | | | PyErr_WriteUnraisable() now displays the exception even if displaying the traceback failed. Moreover, hold a strong reference to sys.stderr while using it. Document that an exception must be set when calling PyErr_WriteUnraisable(), but don't add an assertion to check it at runtime. Cleanup: use longer names for variables and create write_unraisable_exc_file() subfunction.
* bpo-36783: Add new references for C API Documentation changes (GH-13204)Miss Islington (bot)2019-05-191-6/+6
| | | | | (cherry picked from commit d28772ab6967fea136c0707f0207673ebad66f61) Co-authored-by: Edison A <20975616+SimiCode@users.noreply.github.com>
* bpo-31873: Update unicode.rst - 'unicode' capitalization (GH-4125)Miss Islington (bot)2019-05-081-12/+12
| | | | | | | Update 'unicode' capitalization. 'Unicode' is a proper noun, and as such should be capitalized. Changed multiple instances. (cherry picked from commit 85225b6a58a516c50c055d5114668ed2fcdcda8c) Co-authored-by: toonarmycaptain <toonarmycaptain@hotmail.com>
* bpo-36783: Added C API Documentation for Time_FromTimeAndFold and ↵Miss Islington (bot)2019-05-071-0/+16
| | | | | | | PyDateTime_FromDateAndTimeAndFold (GH-13147) (cherry picked from commit 5765ecf79fcee987f2f97c246c64b494324dfd33) Co-authored-by: Edison A <20975616+SimiCode@users.noreply.github.com>
* [3.7] bpo-36427: Document that PyEval_RestoreThread and PyGILState_Ensure ↵Pablo Galindo2019-04-141-0/+12
| | | | | | | | | can terminate the calling thread (GH-12541) (GH-12820) Calling these function from a thread when the runtime is finalizing will terminate the thread, even if the thread was not created by Python. Users can use _Py_IsFinalizing or sys.is_finalizing to check if the interpreter is in the process of being finalized before calling this function to avoid unwanted termination. (cherry picked from commit fde9b33)
* Doc: define PY_SSIZE_T_CLEAN always (GH-12794)Miss Islington (bot)2019-04-131-1/+5
| | | | | (cherry picked from commit c88feceb449d6e85d7e17ec36559206094d10d81) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* [3.7] bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory ↵Victor Stinner2019-04-111-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | (GH-12770) (GH-12788) * bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770) Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline function. The function is now way more efficient, it became a simple comparison on integers, rather than a short loop. It detects also uninitialized bytes and "forbidden bytes" filled by debug hooks on memory allocators. Add unit tests on _PyObject_IsFreed(). (cherry picked from commit 2b00db68554422ec37faba2a80179a0172df6349) * bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782) Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD, 0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte patterns than Windows CRT debug malloc() and free(). (cherry picked from commit 4c409beb4c360a73d054f37807d3daad58d1b567)
* Correct "inplace" with "in-place" (GH-10480)Miss Islington (bot)2019-04-081-2/+2
| | | | | (cherry picked from commit f4efa312d14bc792f59514c5696e29041e05deca) Co-authored-by: Andre Delfino <adelfino@gmail.com>
* bpo-36157:Document PyInterpreterState_Main() (GH-12238)Miss Islington (bot)2019-04-011-0/+5
| | | | | | | | | I have added documentation for `PyInterpreterState_Main()`. I chose to place it under Advanced Debugger Support together with similar functions like `PyInterpreterState_Head()`, `PyInterpreterState_Next(`), and `PyInterpreterState_ThreadHead()` . https://bugs.python.org/issue36157 (cherry picked from commit 8c61739defd88c7f79e86537886c33745843ce01) Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
* bpo-20844: open script file with "rb" mode (GH-12616)Inada Naoki2019-04-011-0/+4
| | | (cherry picked from commit 10654c19b5e6efdf3c529ff9bf7bcab89bdca1c1)
* C API docs: Py_IsInitialized is always safe to call (GH-12630)Miss Islington (bot)2019-03-301-0/+1
| | | | | (cherry picked from commit ddbb978e1065dde21d1662386b26ded359f4b16e) Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
* bpo-36185: Fix typo in Doc/c-api/objbuffer.rst. (GH-12204)Miss Islington (bot)2019-03-071-1/+1
| | | | | (cherry picked from commit ecc161d1209bf6d21f0fd6bef28476eda7cdaf79) Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
* Document the surprising sideeffect PyErr_Print(). (GH-12081)Miss Islington (bot)2019-02-271-2/+6
| | | | | | | | Did you know an API documented as printing the pending traceback would sometimes exit the process? You do now. (cherry picked from commit 4173772031747a9b249be4100b4aa9eda805ea23) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* Correct name of 'defaultobj' parameter in PyDict_SetDefault() signature. ↵Miss Islington (bot)2019-02-251-1/+1
| | | | | | | (GH-11929) (cherry picked from commit d90a141bb947b68601f8d1f37bc98f7b524f0e01) Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
* Fix documented signatures for C API functions. (GH-11236)Miss Islington (bot)2018-12-192-5/+5
| | | | | (cherry picked from commit 57dd79e6f7f33bb4e6817ac58c9cb91de99675e0) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-35461: Document C API functions which suppress exceptions. (GH-11119)Miss Islington (bot)2018-12-187-4/+35
| | | | | (cherry picked from commit 3fcc1e08db6fb7e17acc4a8f63be3e42f52f094b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Correct a couple of unbalanced parenthesis. (GH-10779)Miss Islington (bot)2018-12-051-1/+1
| | | | | (cherry picked from commit 55f41e45b4318cbe19209f5144641344d0049fb8) Co-authored-by: Andre Delfino <adelfino@gmail.com>
* Fix typo in Memory Management doc. (GH-10798)Miss Islington (bot)2018-11-301-1/+1
| | | | | (cherry picked from commit a40700439195a119878150f4f0d425c42ca957ef) Co-authored-by: Kevin Adler <kadler@us.ibm.com>
* bpo-16086: Fix PyType_GetFlags() documentation (GH-10758) (GH-10789)Miss Islington (bot)2018-11-291-1/+4
| | | | | | PyType_GetFlags() return type is unsigned long, not long. (cherry picked from commit 9fbcfc08e5814d7aa9287740187e461425a99f67) Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
* [3.7] bpo-25438: document what codec PyMemberDef T_STRING decodes the char * ↵Miss Islington (bot)2018-11-171-1/+2
| | | | | | | | | | | | | | | | | | as (GH-10580) (GH-10586) Source of T_STRING: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/structmember.cGH-L51 Source of PyUnicode_FromString https://github.com/python/cpython/blob/master/Include/unicodeobject.hGH-L702 https://bugs.python.org/issue25438 (cherry picked from commit 689d555ec135d4115574addd063c358ac4897cc4) Co-authored-by: Windson yang <wiwindson@outlook.com> https://bugs.python.org/issue25438
* bpo-35229: Deprecate _PyObject_GC_TRACK() (GH-10511)Victor Stinner2018-11-131-0/+6
| | | | | Deprecate _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() in the documentation. These macros are removed from Python 3.8 by the commit 1a6be91e6fd65ce9cb88cbbbb193db7e92ec6076.
* [3.7] bpo-35110: Fix unintentional spaces around hyphens and dashes. ↵Serhiy Storchaka2018-10-311-1/+1
| | | | | | (GH-10231). (GH-10253) (cherry picked from commit 3f819ca138db6945ee4271bf13e42db9f9b3b1e4)
* bpo-35044, doc: Use the :exc: role for the exceptions (GH-10037)Miss Islington (bot)2018-10-261-1/+1
| | | | | (cherry picked from commit e483f02423917dc4dfd25f46e5b9e6fce304777d) Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
* [3.7] bpo-11233: Create availability directive for documentation (GH-9692) ↵Cheryl Sabella2018-10-152-8/+18
| | | | | | | | | | | (GH-9830) Replace "Availability: xxx" with ".. availability:: xxx" in the doc. Original patch by Georg Brandl. Co-Authored-By: Georg Brandl <georg@python.org> (cherry picked from commit 2d6097d027e0dd3debbabc702aa9c98d94ba32a3) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* bpo-34762: Fix contextvars C API to use PyObject* pointer types. (GH-9473)Miss Islington (bot)2018-09-211-10/+29
| | | | | (cherry picked from commit 2ec872b31e25cee1f983fe07991fb53f3fd1cbac) Co-authored-by: Yury Selivanov <yury@magic.io>
* bpo-12743: Delete comment from marshal.rst (GH-8457)Miss Islington (bot)2018-07-271-14/+10
| | | | | | | | | Also, update the list of exceptions that may raised by PyMarshal_* functions. We usually don't document exceptions raised by a function, but in this case most of them were already documented in C API and standard library documentation. (cherry picked from commit defcffdf86780e3a184ebb25dc9a7b807753d57a) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
* bpo-33892: Doc: Use gender neutral words (GH-7770)Miss Islington (bot)2018-06-181-1/+1
| | | | | (cherry picked from commit 5092439c2cb32112a5869b138011d38491db90a9) Co-authored-by: Andrés Delfino <adelfino@gmail.com>
* bpo-33592: Document the C API in PEP 567 (contextvars) (GH-7033)Miss Islington (bot)2018-05-222-1/+126
| | | | | (cherry picked from commit b2f5f59ae15564b991f3ca4850e6ad28d9faacbc) Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
* bpo-5945: Improve mappings and sequences C API docs. (GH-7029)Miss Islington (bot)2018-05-224-68/+93
| | | | | (cherry picked from commit f5b1183610d5888db3bbd639b1a0c945dbd8f8dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021)Miss Islington (bot)2018-05-211-1/+1
| | | | | (cherry picked from commit 1179f4b40f375af5c59cd4b6be9cc313fa0e1a37) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>