Commit graph

1155 commits

Author SHA1 Message Date
Dong-hee Na
7b8776511a
[3.9] gh-90359: Update documentation to follow PEP 495. (gh-94800). (gh-94835)
(cherry picked from commit 07374cce52)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-07-28 15:31:17 -04:00
Miss Islington (bot)
f253cf469d
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 07:10:10 -07:00
Miss Islington (bot)
7fd4e6502e
[3.9] GH-92431: Fix footnotes in Doc/c-api/exceptions.rst (GH-92432) (GH-92471)
* 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:37 -07:00
Miss Islington (bot)
326f6ed059
gh-92047: Py_GetVersion multi-digit minor version (GH-92047) (GH-92048) (#92329)
(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:30 +02:00
Miss Islington (bot)
60407e8a19
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:56:55 -07:00
Oleg Iarygin
312e16fb7b
[3.9] gh-91118: Fix docstrings that do not honor --without-doc-strings (GH-31769) (#91664)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit a573cb2fec)
2022-04-19 12:58:34 -07:00
Miss Islington (bot)
b124a3913d
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:32:09 -07:00
Jelle Zijlstra
6eff004b96
[3.9] More minor fixes to C API docs (GH-31525) (GH-32259)
* 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:36 -07:00
Jelle Zijlstra
74138ac954
[3.9] More minor fixes to C API docs (GH-31714) (GH-32260)
* 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 16:00:13 -07:00
Jelle Zijlstra
7190617b56
[3.9] Minor fixes to C API docs (GH-31501) (GH-31526)
* 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)
2022-03-01 20:45:54 -08:00
Miss Islington (bot)
763e23e11e
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:15:57 -08:00
Miss Islington (bot)
7b694b816f
[3.9] bpo-22039: [doc] clarify that there are no plans to disable deleting an attribute via PyObject_SetAttr (GH-30639) (GH-30685)
(cherry picked from commit 3bf6315c4c)


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

Automerge-Triggered-By: GH:iritkatriel
2022-01-19 04:29:52 -08:00
Miss Islington (bot)
238a36b753
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:59:26 -08:00
Miss Islington (bot)
193504acf3
bpo-28737: Document when tp_dealloc should call PyObject_GC_UnTrack() (GH-29246) (GH-29248)
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:23:19 +02:00
Christian Clauss
edef03aaa8
[3.9] [doc] Fix typos found using codespell (GH-28744) (GH-28759) 2021-10-06 15:57:39 +02:00
Miss Islington (bot)
f1d5cdef57
bpo-41203: Replace Mac OS X and OS X with macOS (GH-28515) (GH-28524)
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:57 +03:00
Miss Islington (bot)
6e151ff6fc
[3.9] Fix minor typo in Doc/c-api/type.rst (GH-28432) (GH-28441)
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:12:25 -07:00
Serhiy Storchaka
9f64b1a44b
[3.9] docs: correct references to __isub__ etc (GH-28297). (GH-28415)
(cherry picked from commit 800bd01b6d)

Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com>
2021-09-17 14:14:27 +03:00
Miss Islington (bot)
834a2eb945
[doc] Fix typo c-api/exceptions.rst (GH-27847) (GH-27919)
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 22:09:52 +02:00
Miss Islington (bot)
467c873e49
Note that tp_clear and m_clear are not always called (GH-27581) (GH-27597)
(cherry picked from commit 10faada709)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-08-04 20:24:03 +02:00
Miss Islington (bot)
f26fec4f74
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:48:08 -07:00
Miss Islington (bot)
77a96da556
Document PyMember_GetOne and PyMember_SetOne (GH-27555) (GH-27561)
(cherry picked from commit d382bde220)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-08-02 18:53:55 +02:00
Miss Islington (bot)
7922546859
bpo-43565: Document PyUnicode_KIND's return type as an unsigned int (GH-25724) (GH-27440)
(cherry picked from commit 47fd4726a2)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2021-07-29 11:33:16 +02:00
Victor Stinner
5ed7827b16
bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26878)
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:33 +02:00
Miss Islington (bot)
533bff4e9f
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) (GH-26805)
(cherry picked from commit 291848195f)
2021-06-19 16:16:38 +01:00
Miss Islington (bot)
686c6f303a
bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num'. (GH-26744) (GH-26761)
(cherry picked from commit 7247f6f433)
2021-06-16 20:13:53 +01:00
Ken Jin
c7e95715ec
[3.9] bpo-44392: Add Py_GenericAlias to C API docs (GH-26724) (GH-26757)
(cherry picked from commit 6773c3eaa7)
2021-06-16 08:34:52 -07:00
Miss Islington (bot)
7bd1304d49
bpo-44263: Mention PyType_Ready in the gc protocol warning (GH-26445)
(cherry picked from commit 43cf7c864a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-28 20:53:40 -07:00
Miss Islington (bot)
a30cbaee84
bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases (GH-26442)
(cherry picked from commit 8b55bc3f93)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-28 20:20:54 -07:00
Miss Islington (bot)
fdb11897d7
bpo-43959: clarify the documentation of the PyContextVar C-API (GH-25671) (GH-25689)
(cherry picked from commit 4c49be7668)
2021-04-28 17:11:15 +02:00
Miss Islington (bot)
a838e477a0
bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885)
See PEP 624.
(cherry picked from commit 1330338583)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-03-15 21:48:12 -07:00
Miss Islington (bot)
ea46c7bc50
bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795)
(cherry picked from commit 0d6bd1ca7c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-03-09 03:39:39 -08:00
Miss Islington (bot)
93853b73b6
bpo-36346: Document removal schedule of deprecate APIs (GH-20879)
We will remove wstr cache in Python 3.12. See PEP 623.
(cherry picked from commit 2d6f2eed14)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-02-22 15:30:52 -08:00
Miss Islington (bot)
1cfed3d5b0
closes bpo-43266: Improve array formatting. (GH-24573)
(cherry picked from commit 2d3e463e4a)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-02-19 07:55:44 -08:00
Miss Islington (bot)
1384887505
closes bpo-43254: Fix *snprintf() man page refs. (GH-24563)
(cherry picked from commit e92d67dfbb)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-02-18 18:16:30 -08:00
Miss Islington (bot)
ddc0fa3a1c
Docs: Remove stray semicolon in init.rst (GH-23974)
Removed stray semicolon which was causing the docs to render weirdly (it's the function right under the one [here](https://docs.python.org/3/c-api/init.htmlGH-c._PyInterpreterState_GetEvalFrameFunc)).
(cherry picked from commit 9712358277)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-01-14 08:17:44 -08:00
Miss Islington (bot)
faf4957396
bpo-42528: Improve the docs of most Py*_Check{,Exact} API calls (GH-23602) (GH-24139)
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.
(cherry picked from commit 315fc52db1)

Co-authored-by: Antonio Cuni <anto.cuni@gmail.com>

Co-authored-by: Antonio Cuni <anto.cuni@gmail.com>
2021-01-06 13:54:18 +01:00
Miss Islington (bot)
d153eb8a1e
bpo-42412: Fix possible leaks and check arguments in PyType_FromModuleAndSpec() (GH-23410)
* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.
(cherry picked from commit 1db76394ea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-11-21 03:09:40 -08:00
Miss Skeleton (bot)
46130f8538
bpo-41192: Add documentation of undocumented audit events (GH-22831)
(cherry picked from commit 3f7e990fd4)
2020-10-20 16:05:13 -04:00
Miss Islington (bot)
6dc8e0eb9b
bpo-41802: Document 'PyDict_DelItem' can raise a 'KeyError' (GH-22291)
(cherry picked from commit 20ce62f009)

Co-authored-by: Campbell Barton <ideasman42@gmail.com>
2020-10-02 09:39:20 -07:00
Miss Islington (bot)
fbb9ee0a90
[3.9] bpo-38787: Clarify docs for PyType_GetModule and warn against common mistake (GH-20215) (GH-21984)
(cherry picked from commit d9a966ae08)


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

Automerge-Triggered-By: @Mariatta
2020-09-04 15:32:28 -07:00
Miss Islington (bot)
e2977f6202
Note the buffer slots can be set with PyType_Spec with the unlimited API. (GH-22052)
Follow up to f7c4e23642.
(cherry picked from commit 700fa1b836)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-09-01 22:18:21 -05:00
Victor Stinner
8f88190af5
[3.9] bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) (GH-21901)
* bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844)

Enable Sphinx 3.2 "c_allow_pre_v3" option and disable the
c_warn_on_allowed_pre_v3 option to make the documentation compatible
with Sphinx 2 and Sphinx 3.

(cherry picked from commit 423e77d6de)

* bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858)

Use generic '.. object::' to declare markers, rather than abusing
'..  c:function::' which fails on Sphinx 3.

(cherry picked from commit 43577c01a2)

* bpo-40204: Fix duplicates in the documentation (GH-21857)

Fix two Sphinx 3 issues:

Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'.
Declaration is 'PyBUF_ND'.

Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'.
Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'.

(cherry picked from commit 46d10b1237)

* bpo-40204: Add :noindex: in the documentation (GH-21859)

Add :noindex: to duplicated documentation to fix "duplicate object
description" errors.

For example, fix this Sphinx 3 issue:

Doc/library/configparser.rst:1146: WARNING: duplicate object
description of configparser.ConfigParser.optionxform, other instance
in library/configparser, use :noindex: for one of them

(cherry picked from commit d3ded08048)

* bpo-40204, doc: Fix syntax of C variables (GH-21846)

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.

(cherry picked from commit 474652fe93)

* bpo-40204: Fix reference to terms in the doc (GH-21865)

Sphinx 3 requires to refer to terms with the exact case.

For example, fix the Sphinx 3 warning:

Doc/library/pkgutil.rst:71: WARNING: term Loader not found in case
sensitive match.made a reference to loader instead.

(cherry picked from commit bb0b08540c)

* bpo-40204: Fix duplicated productionlist names in the doc (GH-21900)

Sphinx 3 disallows having more than one productionlist markup with
the same name. Simply remove names in this case, since names are not
shown anyway. For example, fix the Sphinx 3 warning:

Doc/reference/introduction.rst:96: duplicate token description
of *:name, other instance in reference/expressions

(cherry picked from commit 1abeda80f7)
2020-08-19 19:25:22 +02:00
Miss Islington (bot)
b2514c4934
bpo-41098: Doc: Add missing deprecated directives (GH-21162)
PyUnicodeEncodeError_Create has been deprecated with
`Py_DEPRECATED` macro. But it was not documented.
(cherry picked from commit 46e19b61d3)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-08-07 00:49:53 -07:00
Miss Islington (bot)
ea680631b4
bpo-36346: Doc: Update removal schedule of legacy Unicode (GH-21479)
See PEP 623 for detail.
(cherry picked from commit 270b4ad4df)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-08-04 18:56:08 -07:00
Inada Naoki
16f451744b
bpo-41211: Doc: Fix PyLong_FromUnicode (GH-21331)
PyUnicode_EncodeDecimal is not used actually.
2020-07-05 14:28:38 +09:00
Miss Islington (bot)
48f388f02f
bpo-41211: Doc: Fix PyLong_FromUnicodeObject (GH-21325)
It doesn't use PyUnicode_EncodeDecimal. It uses a private API instead.
(cherry picked from commit 9c84417122)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-07-04 21:08:39 -07:00
Miss Islington (bot)
652585c629
Doc: Minor fix to init config C API documentation (GH-21198)
Co-authored-by: Tomer Vromen <tomer.vromen@intel.com>
(cherry picked from commit 741008a57b)

Co-authored-by: tomerv <tomerv@gmail.com>
2020-07-01 02:40:14 -07:00
Inada Naoki
2ea6a9928e
bpo-41123: Remove PyUnicode_AsUnicodeCopy in 3.10 (GH-21227) 2020-06-30 15:24:06 +09:00
Inada Naoki
02134dae44
bpo-41123: Doc: PyLong_FromUnicode will be removed in 3.10 (GH-21205) 2020-06-29 14:26:27 +09:00