summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/structures.rst
Commit message (Collapse)AuthorAgeFilesLines
* gh-97909: Fix markup for `PyMethodDef` members (GH-100089)Miss Islington (bot)2022-12-171-16/+17
| | | | | (cherry picked from commit 8edcb30c3f8bdd8099a093146fedbd9b63a3f667) Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
* [3.11] gh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. cases) ↵Miss Islington (bot)2022-10-051-3/+3
| | | | | | (GH-97775) (#97873) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* [3.11] gh-93738: Documentation C syntax (:c:type:`PyObject` -> ↵Miss Islington (bot)2022-10-051-10/+10
| | | | | | | | :c:expr:`PyObject`) (GH-97776) (#97889) :c:type:`PyObject` -> :c:expr:`PyObject` (cherry picked from commit 0bf6a617ed1832bc4803e532c8d6b3427cf48b13) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-87961: Remove outdated notes from functions that aren't in the Limited ↵Miss Islington (bot)2022-06-101-2/+0
| | | | | | | | | | | | API (GH-93581) (GH-93604) 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. (cherry picked from commit 2c3fe5eeb2b64deb2132d9259e74b521c14fd92d) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* 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.
* More minor fixes to C API docs (GH-31525)Jelle Zijlstra2022-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-47164: Add _PyCFunction_CAST() macro (GH-32192)Victor Stinner2022-03-311-0/+3
| | | Use the macro in C files of the Python/ directory.
* 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.
* Document PyMember_GetOne and PyMember_SetOne (GH-27555)Ken Jin2021-08-021-0/+15
|
* 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-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-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-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-091-1/+1
| | | | | | Add "borrowed reference" and "strong reference" to the documentation glossary. Enhance also Py_INCREF() and Py_NewRef() documentation.
* bpo-40204, doc: Fix syntax of C variables (GH-21846)Victor Stinner2020-08-131-9/+9
| | | | | | | | | | | | | | | For example, fix the following Sphinx 3 errors: Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 5] void \*obj -----^ Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*' Invalid C declaration: Expected end of definition. [error at 8] PyObject* --------^ The modified documentation is compatible with Sphinx 2 and Sphinx 3.
* bpo-39573: Convert Py_REFCNT and Py_SIZE to functions (GH-20429)Victor Stinner2020-05-271-9/+10
| | | | | | | | | | | Convert Py_REFCNT() and Py_SIZE() macros to static inline functions. They cannot be used as l-value anymore: use Py_SET_REFCNT() and Py_SET_SIZE() to set an object reference count and size. Replace &Py_SIZE(self) with &((PyVarObject*)self)->ob_size in arraymodule.c. This change is backward incompatible on purpose, to prepare the C API for an opaque PyObject structure.
* bpo-39573: Convert Py_TYPE() to a static inline function (GH-20290)Dong-hee Na2020-05-251-4/+7
|
* bpo-40584: Update PyType_FromModuleAndSpec() to process tp_vectorcall_offset ↵Hai Shi2020-05-111-3/+5
| | | | (GH-20026)
* bpo-38787: Update structures.rst docs (PEP 573) (GH-19980)Hai Shi2020-05-071-2/+2
|
* bpo-38787: C API for module state access from extension methods (PEP 573) ↵Petr Viktorin2020-05-071-3/+47
| | | | | | | | | (GH-19936) Module C state is now accessible from C-defined heap type methods (PEP 573). Patch by Marcel Plch and Petr Viktorin. Co-authored-by: Marcel Plch <mplch@redhat.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39573: Add Py_IS_TYPE() function (GH-18488)Dong-hee Na2020-02-131-0/+8
| | | Co-Author: Neil Schemenauer <nas-github@arctrix.com>
* bpo-39573: Fix bad copy-paste in Py_SET_SIZE (GH-18496)Brandt Bucher2020-02-131-1/+1
|
* bpo-39573: Add Py_SET_SIZE() function (GH-18400)Victor Stinner2020-02-071-0/+7
| | | Add Py_SET_SIZE() function to set the size of an object.
* bpo-39573: Add Py_SET_TYPE() function (GH-18394)Victor Stinner2020-02-071-0/+7
| | | Add Py_SET_TYPE() function to set the type of an object.
* bpo-39573: Add Py_SET_REFCNT() function (GH-18389)Victor Stinner2020-02-071-0/+7
| | | | Add a Py_SET_REFCNT() function to set the reference counter of an object.
* bpo-39136: Fixed typos (GH-17720)Gurupad Hegde2019-12-281-1/+1
| | | | | funtion -> function; configuraton -> configuration; defintitions -> definitions; focusses -> focuses; necesarily -> necessarily; follwing -> following; Excape -> Escape,
* bpo-36974: expand call protocol documentation (GH-13844)Jeroen Demeyer2019-11-121-1/+2
| | | | | | | | | | | | | | CC @encukou I'm also adding Petr Viktorin as contributor for vectorcall in the "what's new" section. https://bugs.python.org/issue36974 Automerge-Triggered-By: @encukou Automerge-Triggered-By: @encukou
* bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)Serhiy Storchaka2019-10-301-10/+10
| | | | Replace all *NULL* with ``NULL``.
* bpo-38140: Document offsets in PyMemberDef (GH-16354)Petr Viktorin2019-09-251-0/+13
| | | | | | bpo-38140: Document offsets in PyMemberDef Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
* bpo-36971: add subsections in C API "Common Object Structures" page (#13446)Jeroen Demeyer2019-09-101-0/+10
|
* bpo-37540: vectorcall: keyword names must be strings (GH-14682)Jeroen Demeyer2019-08-161-0/+1
| | | | | | | | The fact that keyword names are strings is now part of the vectorcall and `METH_FASTCALL` protocols. The biggest concrete change is that `_PyStack_UnpackDict` now checks that and raises `TypeError` if not. CC @markshannon @vstinner https://bugs.python.org/issue37540
* bpo-28805: document METH_FASTCALL (GH-14079)Jeroen Demeyer2019-06-161-12/+51
|
* Doc: Replace the deprecated highlightlang directive by highlight. (#13377)Stéphane Wirtel2019-05-171-1/+1
| | | | highlightlang is deprecated since April 2018 in Sphinx. See https://github.com/sphinx-doc/sphinx/pull/4845
* bpo-25438: document what codec PyMemberDef T_STRING decodes the char * as ↵Windson yang2018-11-171-1/+2
| | | | | | | | | | | (GH-10580) Source of T_STRING: https://github.com/python/cpython/blob/e42b705188271da108de42b55d9344642170aa2b/Python/structmember.c#L51 Source of PyUnicode_FromString https://github.com/python/cpython/blob/master/Include/unicodeobject.h#L702 https://bugs.python.org/issue25438
* bpo-29916: Include PyGetSetDef in C API extension documentation. (#831)Michael Seifert2017-09-151-0/+40
|
* bpo-29918: Add missed "const" modifiers in C API documentation. (#846)Serhiy Storchaka2017-03-301-34/+34
|
* bpo-29917: DOC: Remove link from PyMethodDef (#890)csabella2017-03-301-2/+2
|
* Issue #15657: METH_KEYWORDS cannot be used alone in Python 3Martin Panter2017-01-111-1/+1
|
* Issue #28496: Mark up constants 0, 1 and -1 that denote return values orSerhiy Storchaka2016-10-271-1/+1
| | | | special input values as literal text.
* Issue #15657: Delete incorrect statement from PyMethodDef documentationBerker Peksag2016-06-121-3/+2
|
* Fix usage of the default role.Zachary Ware2015-07-071-3/+4
| | | | | The changes to Doc/library/unittest.mock.rst are almost entirely a selective backport of the 3.5 page.
* Fix suspicious markupZachary Ware2015-07-071-1/+1
|
* issue9014: Include more formatting on :c:type:`PyObject` etc.Gregory P. Smith2015-04-141-3/+3
|
* issue9014: Properly document PyObject_HEAD and friends post-PEP-3123.Gregory P. Smith2015-04-141-29/+41
|
* fix instances of consecutive articles (closes #23221)Benjamin Peterson2015-01-131-1/+1
| | | | Patch by Karan Goel.
* Migrate to Sphinx 1.0 C language constructs.Georg Brandl2010-10-061-46/+46
|
* Merged revisions 77271 via svnmerge fromEzio Melotti2010-01-031-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77271 | ezio.melotti | 2010-01-03 11:09:55 +0200 (Sun, 03 Jan 2010) | 1 line :stmt: -> :keyword: ........
* Merged revisions 77157 via svnmerge fromBenjamin Peterson2009-12-301-1/+4
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77157 | benjamin.peterson | 2009-12-30 13:34:10 -0600 (Wed, 30 Dec 2009) | 5 lines check if the attribute is set before deleting it with T_OBJECT_EX (fixes #7604) Also, add a note to the docs about the better behavior of T_OBJECT_EX as compared to T_OBJECT. ........
* #6421: The self argument of module-level PyCFunctions is now a reference to ↵Georg Brandl2009-07-111-9/+7
| | | | the module object.