Commit Graph

1236 Commits

Author SHA1 Message Date
Miss Islington (bot) 8a01502e2d
gh-90359: Unify documentation style for datetime.rst (gh-94836)
(cherry picked from commit 967da5febb)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-07-13 17:51:03 -07:00
Miss Islington (bot) 381b86bde8
gh-90359: Update documentation to follow PEP 495. (gh-94800)
(cherry picked from commit 07374cce52)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-07-13 17:16:44 -07:00
Łukasz Langa 6e47020d31
[3.10] Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551) (GH-94558)
Discussion: https://discuss.python.org/t/slight-grammar-fix-throughout-adverbs-dont-need-hyphen/17021
(cherry picked from commit 3440d197a5)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2022-07-05 14:30:37 +02:00
Miss Islington (bot) 3473a128d1
[doc] fix typo in reference to tp_descr_get and tp_descr_set (GH-94140)
(cherry picked from commit 32d595fdcd)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
2022-06-26 03:11:43 -07:00
Miss Islington (bot) 5b2ad48431
gh-87961: Remove outdated notes from functions that aren't in the Limited API (GH-93581) (GH-93605)
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 2c3fe5eeb2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-06-10 16:04:47 +02:00
Miss Islington (bot) 2139583bf9
Doc: Update references and examples of old, unsupported OSes and uarches (GH-92791) (GH-93639)
(cherry picked from commit a5ba0f4ebc)

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-06-09 16:15:49 +02:00
Miss Islington (bot) 1815d8e64f
gh-91755: Document Py_IncRef and Py_DecRef as C functions (GH-91805)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 58a3d28039)

Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com>
2022-05-18 02:00:00 -07:00
Miss Islington (bot) 48f2d8de24
Document Py_ssize_t. (GH-92512)
It fixes 252 errors from a Sphinx nitpicky run (sphinx-build -n). But
there's 8182 errors left.

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit 664aa94b57)

Co-authored-by: Julien Palard <julien@palard.fr>
2022-05-13 06:32:39 -07:00
Miss Islington (bot) f40731fb51
[3.10] GH-92431: Fix footnotes in Doc/c-api/exceptions.rst (GH-92432) (GH-92470)
* Remove redundant footnote ref: the footnote has been removed
* Fix footnote ref to match footnote
* Convert footnotes into reST footnotes: will error if missing
(cherry picked from commit 788ef54bc9)


Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-08 08:28:47 -07:00
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