Commit graph

1227 commits

Author SHA1 Message Date
Miss Islington (bot)
229dc17f7a
gh-92047: Py_GetVersion multi-digit minor version (GH-92047) (GH-92048) (#92330)
(cherry picked from commit 43b135f94e)

Co-authored-by: Robert Howlett <robert@howletts.org.uk>

Co-authored-by: Robert Howlett <robert@howletts.org.uk>
2022-05-06 14:47:09 +02:00
Miss Islington (bot)
367faf71ea
Document the lifetime of PyUnicode_AsUTF8String (GH-92325)
The current wording implied this, but didn't state it explicitly.
(cherry picked from commit 740da8d37a)

Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
2022-05-06 02:55:01 -07:00
Oleg Iarygin
e7e8a9fa4f
[3.10] gh-91118: Fix docstrings that do not honor --without-doc-strings (GH-31769) (#91662)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit a573cb2fec)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-04-19 13:01:09 -07:00
Miss Islington (bot)
b4abef2295
c-api docs: There are five fields, not four (GH-32379)
(cherry picked from commit 4c92427fb8)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-07 07:27:40 -07:00
Jelle Zijlstra
11f5fd1135
[3.10] More minor fixes to C API docs (GH-31525) (GH-32258)
* 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.
(cherry picked from commit 897bc6f928)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-02 16:00:51 -07:00
Miss Islington (bot)
5830a288ab
More minor fixes to C API docs (GH-31714)
* init_config: wording fixes

* bytearray: remove XXX, there is a good link to the buffer docs

* bytes, call, exceptions: minor wording fixes
(cherry picked from commit 677a879466)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-02 12:54:04 -07:00
Miss Islington (bot)
98e2ee60bd
Add missing "to" to two tp_flags notes (GH-31624)
(cherry picked from commit 422fdb3717)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-02-28 17:45:26 -08:00
Miss Islington (bot)
b0de6299a8
bpo-40421: Fix PyFrame_GetCode() documentation (GH-31535)
Fix PyFrame_GetBack() and PyFrame_GetCode() return type in
the documentation.
(cherry picked from commit 78859e58e4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-02-23 11:12:51 -08:00
Miss Islington (bot)
28d9353305
Minor fixes to C API docs (GH-31501)
* C API docs: move PyErr_SetImportErrorSubclass docs

It was in the section about warnings, but it makes more sense to
put it with PyErr_SetImportError.

* C API docs: document closeit argument to PyRun_AnyFileExFlags

It was already documented for PyRun_SimpleFileExFlags.

* textual fixes to unicode docs

* Move paragraph about tp_dealloc into tp_dealloc section

* __aiter__ returns an async iterator, not an awaitable
(cherry picked from commit 43cf44ddcc)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-02-22 20:57:02 -08:00
Miss Islington (bot)
68a31dba97
no-issue: Fix documentation typos. (GH-30576)
(cherry picked from commit d05a66339b)

Co-authored-by: Piotr Fusik <piotr@fusik.info>
2022-01-21 04:45:42 -08:00
Miss Islington (bot)
0861a50bd4
bpo-22039: [doc] clarify that there are no plans to disable deleting an attribute via PyObject_SetAttr (GH-30639) (GH-30684)
(cherry picked from commit 3bf6315c4c)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-01-19 12:34:17 +00:00
Miss Islington (bot)
4cfb10979d
closes bpo-46253: Change Py_UNICODE to Py_UCS4 in the C API docs to match the current source code (GH-30387)
(cherry picked from commit 43c5c1369c)

Co-authored-by: Julian Gilbey <julian-git@d-and-j.net>
2022-01-11 06:53:08 -08:00
Brett Cannon
99aad31b7a
[3.10] bpo-45250: fix docs regarding __iter__ and iterators being inconsistently required by CPython (GH-29170) (GH-29650)
It is now considered a historical accident that e.g. `for` loops and the `iter()` built-in function do not require the iterators they work with to define `__iter__`, only `__next__`.
(cherry picked from commit be36e06340)

Co-authored-by: Brett Cannon <brett@python.org>
2021-11-22 15:09:15 -08:00
Sam Gross
9e0012116a
[3.10] bpo-28737: Document when tp_dealloc should call PyObject_GC_UnTrack() (GH-29246) (GH-29249)
Objects that support garbage collection ("container" objects) should
call PyObject_GC_UnTrack() from their destructors before clearing any
fields which may point to other "container" objects.
(cherry picked from commit 35e1ff38ee)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2021-10-28 21:22:57 +02:00
Christian Clauss
d15f47d179
[3.10] [doc] Fix typos found using codespell (GH-28744) (GH-28758) 2021-10-06 15:56:57 +02:00
Miss Islington (bot)
1493e1a40d
bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515) (GH-28523)
Replace old names when they refer to actual versions of macOS.
Keep historical names in references to older versions.

Co-authored-by: Patrick Reader <_@pxeger.com>
(cherry picked from commit 36122e1814)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-23 13:25:31 +03:00
Miss Islington (bot)
5683902e06
[3.10] Fix minor typo in Doc/c-api/type.rst (GH-28432) (GH-28440)
retreived-> retrieved
(cherry picked from commit af08f1ba40)


Co-authored-by: Konstantin Popov <konst.hardy@gmail.com>

Automerge-Triggered-By: GH:Fidget-Spinner
2021-09-17 19:11:51 -07:00
Miss Islington (bot)
e2856859f6
docs: correct references to __isub__ etc (GH-28297)
(cherry picked from commit 800bd01b6d)

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-09-16 03:10:10 -07:00
Miss Islington (bot)
53257cf19f
bpo-45123: PyAiter_Check and PyObject_GetAiter fix & rename. (GH-28194) (GH-28199)
Fix PyAiter_Check to only check for the `__anext__` presense (not for
`__aiter__`). Rename `PyAiter_Check()` to `PyAIter_Check()`,
`PyObject_GetAiter()` -> `PyObject_GetAIter()`.
2021-09-07 12:43:33 +01:00
Miss Islington (bot)
f709360520
[doc] Fix typo c-api/exceptions.rst (GH-27847)
Co-authored-by: Tianqing Peng <pengtianqing@yimian.com.cn>
(cherry picked from commit dcbf7ff6a7)

Co-authored-by: Sunny Bean <ptq008@gmail.com>
2021-08-23 12:40:36 -07:00
Miss Islington (bot)
f4b3217874
Note that tp_clear and m_clear are not always called (GH-27581)
(cherry picked from commit 10faada709)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-08-04 11:23:41 -07:00
Miss Islington (bot)
952aa31c89
bpo-41886: Fix documented type of PyType_Type (GH-22454)
(cherry picked from commit ac811f9b5a)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2021-08-03 10:50:24 -07:00
Miss Islington (bot)
9de590151d
Document PyMember_GetOne and PyMember_SetOne (GH-27555)
(cherry picked from commit d382bde220)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-08-02 10:08:49 -07:00
Miss Islington (bot)
6b922dae6c
bpo-41103: Resurrect the old buffer protocol. (GH-27437) (GH-27441)
Revert "bpo-41103: Remove old buffer protocol support (GH-21117)"

This reverts commit 6f8a6ee59c.
(cherry picked from commit ce5e1a6809)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-07-29 13:31:42 +02:00
Miss Islington (bot)
b5bdc0c407
bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724) (GH-27439)
(cherry picked from commit 47fd4726a2)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2021-07-29 11:31:02 +02:00
Miss Islington (bot)
632e8a6959
bpo-42747: Remove Py_TPFLAGS_HAVE_AM_SEND and make Py_TPFLAGS_HAVE_VERSION_TAG no-op (GH-27260) (GH-27306)
* 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.
(cherry picked from commit a4760cc32d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-07-23 16:56:53 +02:00
Miss Islington (bot)
bea618d780
Fix a small typo in the docs (GH-26991) (GH-27003)
(cherry picked from commit a79e2b6497)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2021-07-03 15:15:49 -03:00
Miss Islington (bot)
dc10264eb8
bpo-40939: Remove documentation for PyParser_* & add porting notes (GH-26855) (GH-26898)
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.

(cherry picked from commit 29987f7265)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-06-28 11:35:52 +02:00
Victor Stinner
ece3841d3d
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26877)
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.

(cherry picked from commit 489699ca05)
2021-06-23 17:47:38 +02:00
Miss Islington (bot)
139c5778c2
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) (GH-26804)
(cherry picked from commit 291848195f)
2021-06-19 16:16:13 +01:00
Miss Islington (bot)
c689e0a7e2
bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num'. (GH-26744) (GH-26760)
(cherry picked from commit 7247f6f433)
2021-06-16 20:13:37 +01:00
Miss Islington (bot)
84ce737f73
bpo-44392: Add Py_GenericAlias to C API docs (GH-26724)
Also fix stable ABI type definitions
(cherry picked from commit 6773c3eaa7)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-06-16 07:34:45 -07:00
Miss Islington (bot)
d338ce0796
bpo-42085: [docs] Add versionadded for am_send in type object documentation (GH-25465) (GH-26453)
(cherry picked from commit 0b11c429c7)

Co-authored-by: Martmists <mail@martmists.com>
2021-05-29 21:38:00 +01:00
Miss Islington (bot)
d8ce746e7c
bpo-44263: Mention PyType_Ready in the gc protocol warning (GH-26445) (#26446)
(cherry picked from commit 43cf7c864a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-29 18:49:16 +01:00
Miss Islington (bot)
11049bece1
bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases (GH-26442) (GH-26443)
(cherry picked from commit 8b55bc3f93)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-29 04:21:26 +01:00
Miss Islington (bot)
5abc681019
Reword paragraph on specific value for Py_LIMITED_API (GH-26101) (GH-26123)
(cherry picked from commit ddd30b2dd2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-05-14 14:28:08 +02:00
Miss Islington (bot)
373937182e
bpo-43795: PEP 652 user documentation (GH-25668) (GH-26034)
- 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
(cherry picked from commit b05955d6f5)

Co-authored-by: Petr Viktorin <encukou@gmail.com>

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-05-13 22:29:09 -07:00
Brandt Bucher
9387fac100
bpo-43977: Document the new pattern matching type flags (GH-25734) 2021-05-02 15:35:00 -07:00
JT
e08c67372d
bpo-43928: Fix 'succesfully' typo in document (GH-25569) 2021-04-30 18:35:07 -04:00
Victor Stinner
3bb09947ec
bpo-43916: Add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag (GH-25721)
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.
2021-04-30 12:46:15 +02:00
Victor Stinner
abfd6388cd
bpo-43774: Enhance debug build documentation (GH-25712)
* 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.
2021-04-29 13:06:59 +02:00
Victor Stinner
645ed62fb4
bpo-43774: Remove unused PYMALLOC_DEBUG macro (GH-25711)
Enhance also the documentation of debug hooks on memory allocators.
2021-04-29 10:47:47 +02:00
Victor Stinner
5bd0619533
bpo-43908: Document Static Types in the C API (GH-25710)
Update also PyTypeObject structure definition in the doc.
2021-04-29 10:26:34 +02:00
Erlend Egeberg Aasland
3b52c8d66b
bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag (GH-25520)
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>
2021-04-28 19:02:42 +02:00
scoder
3cc481b9de
bpo-28254: Add a C-API for controlling the GC state (GH-25687)
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>
2021-04-28 18:12:16 +02:00
scoder
4c49be7668
bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671)
Automerge-Triggered-By: GH:scoder
2021-04-28 07:03:19 -07:00
Ikko Ashimine
cfaa2d338b
Fix typo in exceptions.rst (GH-25434)
attemps -> attempts
2021-04-17 12:02:53 +05:30
Victor Stinner
62ec638648
bpo-43862: Enhance -W cmdline option documentation (GH-25439)
The -W format is "action:message:category:module:lineno".

Update also the Python manual page.
2021-04-16 19:12:14 +02:00
Victor Stinner
85918e4ab6
bpo-43774: Add more links to configure options (GH-25363) 2021-04-12 23:27:35 +02:00
Pablo Galindo
20ac34772a
Fix Sphinx errors in the documentation and re-activate the suspicious check (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.
2021-04-12 20:53:15 +01:00