summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/module.rst
Commit message (Collapse)AuthorAgeFilesLines
* gh-107298: Fix numerous ref errors and typos in the C API docs (GH-108258)Serhiy Storchaka2023-08-221-0/+4
|
* gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552)Eric Snow2023-08-071-1/+1
| | | | | PEP 683 (immortal objects) revealed some ways in which the Python documentation has been unnecessarily coupled to the implementation details of reference counts. In the end users should focus on reference ownership, including taking references and releasing them, rather than on how many reference counts an object has. This change updates the documentation to reflect that perspective. It also updates the docs relative to immortal objects in a handful of places.
* gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (#107403)Eric Snow2023-07-311-0/+31
| | | It was added in 3.12 for PEP 684 (per-interpreter GIL).
* gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345)Serhiy Storchaka2023-07-271-1/+1
|
* gh-107298: Fix more Sphinx warnings in the C API doc (#107329)Victor Stinner2023-07-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Declare the following functions as macros, since they are actually macros. It avoids a warning on "TYPE" or "macro" argument. * PyMem_New() * PyMem_Resize() * PyModule_AddIntMacro() * PyModule_AddStringMacro() * PyObject_GC_New() * PyObject_GC_NewVar() * PyObject_New() * PyObject_NewVar() Add C standard C types to nitpick_ignore in Doc/conf.py: * int64_t * uint64_t * uintptr_t No longer ignore non existing "__int" type in nitpick_ignore. Update Doc/tools/.nitignore
* gh-107091: Fix some uses of :c:member: role (GH-107129)Serhiy Storchaka2023-07-261-4/+4
|
* gh-107091: Fix the use of some C domain roles (#107092)Serhiy Storchaka2023-07-231-1/+1
|
* gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920)Serhiy Storchaka2023-07-211-3/+3
|
* bpo-42327: C API: Add PyModule_Add() function (GH-23443)Serhiy Storchaka2023-07-181-34/+31
| | | | | It is a fixed implementation of PyModule_AddObject() which consistently steals reference both on success and on failure.
* GH-97950: Use new-style index directive ('object') (#104158)Adam Turner2023-05-041-1/+1
| | | | | | | | | | | * Uncomment object removal in pairindextypes * Use new-style index directive ('object') - C API * Use new-style index directive ('object') - Library * Use new-style index directive ('object') - Reference * Use new-style index directive ('object') - Tutorial
* gh-101973: Fix parameter reference for PyModule_FromDefAndSpec (#101976)Oleg Iarygin2023-02-171-2/+2
|
* gh-93738: Documentation C syntax (Function glob patterns -> literal markup) ↵Adam Turner2022-10-051-2/+2
| | | | (#97774)
* Note that tp_clear and m_clear are not always called (GH-27581)Petr Viktorin2021-08-041-0/+6
|
* bpo-42528: Improve the docs of most Py*_Check{,Exact} API calls (GH-23602)Antonio Cuni2021-01-061-1/+2
| | | | | 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-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-40204, doc: Fix syntax of C variables (GH-21846)Victor Stinner2020-08-131-2/+2
| | | | | | | | | | | | | | | 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-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607)Brad Solomon2020-04-271-1/+1
| | | | | | | Adds a short description of `PyDoc_STRVAR` and `PyDoc_STR` to "Useful macros" section of C-API docs. Currently, there is [one lone mention](https://docs.python.org/3/c-api/module.html?highlight=pydoc_strvar#c.PyModuleDef) in the C-API reference, despite the fact that `PyDoc_STRVAR` is ubiquitous to `Modules/`. Additionally, this properly uses `c:macro` within `Doc/c-api/module.rst` to link.
* bpo-38644: Make tstate more explicit inside pystate.c (GH-19182)Victor Stinner2020-03-261-0/+4
| | | | Fix PyInterpreterState_New(): Don't call PyErr_SetString() when there is no current Python thread state (if tstate is NULL).
* bpo-40024: Add PyModule_AddType() helper function (GH-19088)Dong-hee Na2020-03-221-1/+11
|
* bpo-39824: module_traverse() don't call m_traverse if md_state=NULL (GH-18738)Victor Stinner2020-03-171-10/+34
| | | | | | | | | | | | | Extension modules: m_traverse, m_clear and m_free functions of PyModuleDef are no longer called if the module state was requested but is not allocated yet. This is the case immediately after the module is created and before the module is executed (Py_mod_exec function). More precisely, these functions are not called if m_size is greater than 0 and the module state (as returned by PyModule_GetState()) is NULL. Extension modules without module state (m_size <= 0) are not affected. Co-Authored-By: Petr Viktorin <encukou@gmail.com>
* bpo-38159: Clarify documentation of PyState_AddModule (GH-16101)Petr Viktorin2019-11-011-0/+11
| | | | | This was never intented to be called manually from PyInit_*. Also, clarify PyState_RemoveModule return value.
* bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)Serhiy Storchaka2019-10-301-17/+17
| | | | Replace all *NULL* with ``NULL``.
* bpo-26868: Fix example usage of PyModule_AddObject. (#15725)Brandt Bucher2019-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
* 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-32374: m_traverse may be called with m_state=NULL (GH-5140)Marcel Plch2018-03-171-3/+9
| | | | | Multi-phase initialized modules allow m_traverse to be called while the module is still being initialized, so module authors may need to account for that.
* bpo-30656: Fix Python C API Module Objects documentation (GH-2170)Emily Morehouse2017-06-131-1/+1
| | | `PyModule_New()` now refers to `PyModule_NewObject()`
* bpo-29918: Add missed "const" modifiers in C API documentation. (#846)Serhiy Storchaka2017-03-301-4/+4
|
* Issue #27782: Fix m_methods handling in multiphase initNick Coghlan2016-08-211-1/+1
| | | | | | | | Multi-phase extension module import now correctly allows the ``m_methods`` field to be used to add module level functions to instances of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
* Issue #12946: Document that PyModule_GetDict can fail in some casesBerker Peksag2016-08-191-4/+7
|
* Issue #24314: Fix doc links for general attributes like __name__, __dict__Martin Panter2016-06-181-2/+2
|
* Issue #27125: Remove duplicated words from documentation and commentsMartin Panter2016-05-301-1/+1
|
* Correct “an” → “a” with “Unicode”, “user”, “UTF”, etcMartin Panter2016-04-151-1/+1
| | | | This affects documentation, code comments, and a debugging messages.
* Close #24458: PEP 489 documentationNick Coghlan2015-07-031-77/+243
| | | | Patch by Petr Viktorin.
* PEP 489: Multi-phase extension module initializationNick Coghlan2015-05-231-26/+66
| | | | | | | | | | | | | | | | | | | | | | | Known limitations of the current implementation: - documentation changes are incomplete - there's a reference leak I haven't tracked down yet The leak is most visible by running: ./python -m test -R3:3 test_importlib However, you can also see it by running: ./python -X showrefcount Importing the array or _testmultiphase modules, and then deleting them from both sys.modules and the local namespace shows significant increases in the total number of active references each cycle. By contrast, with _testcapi (which continues to use single-phase initialisation) the global refcounts stabilise after a couple of cycles.
* Merge with 3.3Zachary Ware2014-02-261-1/+1
|\
| * Fix several C-API doc typos caught by tomo cocoa on docs@.Zachary Ware2014-02-261-1/+1
| | | | | | | | | | The signature and description of PyException_SetCause now use "cause" rather than "ctx" to match the code.
* | Issue #18668: Further clarify m_size setting for non-negative valuesEli Bendersky2013-08-101-4/+4
|\ \ | |/
| * Issue #18668: Further clarify m_size setting for non-negative valuesEli Bendersky2013-08-101-4/+4
| |
* | Closing #18668: Properly document setting m_size in PyModuleDefEli Bendersky2013-08-071-4/+10
|\ \ | |/
| * Issue #18668: Properly document setting m_size in PyModuleDefEli Bendersky2013-08-071-4/+10
| |
* | #17115,17116: Have modules initialize the __package__ and __loader__Brett Cannon2013-05-041-2/+9
|/ | | | | | | | | | | | | | | | | attributes to None. The long-term goal is for people to be able to rely on these attributes existing and checking for None to see if they have been set. Since import itself sets these attributes when a loader does not the only instances when the attributes are None are from someone overloading __import__() and not using a loader or someone creating a module from scratch. This patch also unifies module initialization. Before you could have different attributes with default values depending on how the module object was created. Now the only way to not get the same default set of attributes is to circumvent initialization by calling ModuleType.__new__() directly.
* #17363: fix arguments in PyState_AddModule and PyState_RemoveModule docs.Ezio Melotti2013-03-061-2/+2
|
* Issue #15042: Add PyState_AddModule and PyState_RemoveModule.Martin v. Löwis2012-06-221-1/+21
| | | | | | Add version guard for Py_LIMITED_API additions. Issue #15081: Document PyState_FindModule. Patch by Robin Schreiber.
* Update C API docs for PEP 393.Georg Brandl2011-10-071-1/+1
|
* merge 3.2Benjamin Peterson2011-04-301-1/+1
|\
| * merge 3.1Benjamin Peterson2011-04-301-1/+1
| |\
| | * fix function name in example (closes #11966)Benjamin Peterson2011-04-301-1/+1
| | |
* | | Issue #3080: Add PyModule_NewObject() functionVictor Stinner2011-03-041-1/+9
| | |
* | | Issue #3080: Add PyModule_GetNameObject()Victor Stinner2011-02-231-7/+15
|/ / | | | | | | | | repr(module) uses %R to format module name and filenames, instead of '%s' and '%U', so surrogates from undecodable bytes in a filename (PEP 383) are escaped.
* | Migrate to Sphinx 1.0 C language constructs.Georg Brandl2010-10-061-44/+44
| |