Commit Graph

1405 Commits

Author SHA1 Message Date
Serhiy Storchaka cfa9f3b7cc
[3.11] gh-107091: Fix some uses of :c:member: role (GH-107129) (GH-107311)
(cherry picked from commit af61cb9c78)
2023-07-26 19:35:16 +00:00
Miss Islington (bot) 579868e8f1
[3.11] Fix PyVectorcall_Function doc versionadded (GH-107140) (#107174)
Fix PyVectorcall_Function doc versionadded (GH-107140)

The documentation implies that PyVectorcall_Function() was available in Python 3.8.
This is half-true - it was available under a different name. I think it's clearer to set
the "version added" to 3.9.
(cherry picked from commit 0a9b339363)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2023-07-24 13:06:46 +00:00
Erlend E. Aasland b3e600a632
[3.11] gh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (#107062) (#107157)
(cherry picked from commit b447e19e72)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-23 23:49:48 +02:00
Serhiy Storchaka d2cdf0888b
[3.11] gh-107091: Fix the use of some C domain roles (GH-107092) (GH-107121)
(cherry picked from commit 08a228da05)
2023-07-23 15:06:32 +03:00
wulmer c51f766ebb
[3.11] gh-101100: Fix some broken sphinx references (GH-107095). (#107120) 2023-07-23 05:56:09 -06:00
Serhiy Storchaka ec8718dd7c
[3.11] gh-106948: Add standard external names to nitpick_ignore (GH-106949) (#107061)
It includes standard C types, macros and variables like "size_t",
"LONG_MAX" and "errno", and standard environment variables like "PATH"..
(cherry picked from commit f8b7fe2f26)
2023-07-23 11:24:37 +02:00
Serhiy Storchaka b338ac7540
[3.11] gh-106909: Use role :const: for referencing module constants (GH-106910) (GH-106957)
(cherry picked from commit 4b9948617f)
2023-07-21 14:49:57 +03:00
Serhiy Storchaka cc76113cf8
[3.11] gh-106892: Use roles :data: and :const: for referencing module variables (GH-106894) (GH-106955)
(cherry picked from commit d036db728e)
2023-07-21 14:49:21 +03:00
Serhiy Storchaka 6bde1b9f04
[3.11] gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920) (GH-106952)
(cherry picked from commit fcc816dbff)
2023-07-21 14:48:30 +03:00
Miss Islington (bot) f5e29f4245
[3.11] gh-101100: Docs: Fix references to several numeric dunders (GH-106278) (#106282)
gh-101100: Docs: Fix references to several numeric dunders (GH-106278)
(cherry picked from commit a8ae73965b)

Co-authored-by: F3eQnxN3RriK <drsuaimqjgar@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-30 15:40:13 +01:00
Miss Islington (bot) c69f29f879
[3.11] gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-106047) (#106071)
gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-106047)

Use a note:: tag so that these dict and object API deficiencies show up clearly.

A caution:: tag was considered, but our current python docs rendering doesn't do much with that (no box or color change).  warning:: seemed too extreme.  note looks good.
(cherry picked from commit 19d6511b0b)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-06-24 16:30:09 -07:00
Irit Katriel e422f35267
[3.11] gh-105196: Fix indentations of section headings in C API docs (#105672) (#105786)
gh-105196: Fix indentations of section headings in C API docs (#105672)

Co-authored-by: TATHAGATA ROY <royzen9495@gmail.com>
2023-06-14 22:34:37 -05:00
Miss Islington (bot) 8de607ab1c
[3.11] gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185) (#105219)
gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185)
(cherry picked from commit ee26ca13a1)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-06-02 08:28:35 +00:00
Miss Islington (bot) 4b11af058e
[3.11] GH-97950: Use new-style index directive ('builtin') (GH-104164) (#104221)
GH-97950: Use new-style index directive ('builtin') (GH-104164)

* Uncomment builtin removal in pairindextypes

* Use new-style index directive ('builtin') - C API

* Use new-style index directive ('builtin') - Extending

* Use new-style index directive ('builtin') - Library

* Use new-style index directive ('builtin') - Reference

* Use new-style index directive ('builtin') - Tutorial
(cherry picked from commit f5088006ca)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-06 07:14:37 +03:00
Miss Islington (bot) c463796ba7
[3.11] GH-97950: Use new-style index directive ('object') (GH-104158) (#104159)
GH-97950: Use new-style index directive ('object') (GH-104158)

* 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
(cherry picked from commit 6ab463684b)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-05-04 13:14:16 +03:00
Adam Turner 00563694bb
[3.11] GH-97950: Use new-style index directive ('module') (GH-103996) (#104154) 2023-05-04 11:39:15 +03:00
Inada Naoki 4041251a36
gh-103883: Doc: Move PyUnicode_FromObject doc (GH-103913)
This API is one of Unicode creator APIs.
This APIs should not be placed in PEP 393 deprecated APIs.

Fixes: gh-103883

(cherry picked from commit ce2383ec66)
2023-04-27 15:05:35 +09:00
Hugo van Kemenade 85c686a1a5
[3.11] gh-101100: Document PyObject_ClearWeakRefs, gzip's name, and asyncio.iscoroutine (#103001) 2023-03-25 09:43:52 +02:00
Miss Islington (bot) a7a373e1c5
[3.11] gh-102595: Document `PyObject_Format` c-api function (GH-102596) (GH-102879)
(cherry picked from commit 910a64e301)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Def: 5ffdaf748d/Include/abstract.hGH-L389

Automerge-Triggered-By: GH:encukou
2023-03-22 02:32:02 -07:00
Miss Islington (bot) 3ddf397217
gh-101100: Documenting --prefix and --exec-prefix. (GH-102695)
(cherry picked from commit 61b9ff35cb)

Co-authored-by: Julien Palard <julien@palard.fr>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-03-15 15:13:48 -07:00
Miss Islington (bot) 00791f23b7
gh-102383: [docs] Arguments of `PyObject_CopyData` are `PyObject *` (GH-102390)
(cherry picked from commit 7b9132057d)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-03-03 09:27:20 -08:00
Miss Islington (bot) 61e0bbdb0c
Fix typo in `Py_GetPythonHome` signature (GH-102168)
(cherry picked from commit 9bba8035bd)

Co-authored-by: Tanner Firl <105078804+TannerFirl@users.noreply.github.com>
2023-02-23 05:38:08 -08:00
Miss Islington (bot) 559d0e8073
gh-101973: Fix parameter reference for PyModule_FromDefAndSpec (GH-101976)
(cherry picked from commit a3bb7fbe7e)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-02-17 00:50:46 -08:00
Miss Islington (bot) 4aeae28671
GH-101898: Fix missing term references for hashable definition (GH-101899)
Fix missing term references for hashable definition
(cherry picked from commit 3690688149)

Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
2023-02-14 02:45:42 -08:00
Miss Islington (bot) 4c763463fc
Add missing `versionadded` directive for `PyCode_Addr2Location` (GH-101347)
(cherry picked from commit f11a3d1ebe)

Co-authored-by: Max Bachmann <oss@maxbachmann.de>
2023-02-03 19:40:51 -08:00
Miss Islington (bot) bab79942c4
[docs] Mention how to get/set a bigint PyLong via the C API (GH-101270)
We don't need direct C APIs to get at a bigint representation of PyLong but we
do want the few people who need to understand how.

Additional Author:  CAM-Gerlach
(cherry picked from commit e244401ce5)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-01-23 21:31:06 -08:00
Miss Islington (bot) c915f00eca
docs: fix `ssizeobjargproc` parameters (GH-100736)
(cherry picked from commit 5fb1c08e15)

Co-authored-by: David Lechner <david@lechnology.com>
2023-01-04 07:40:06 -08:00
Miss Islington (bot) 1bc0705e64
Fix deprecation doc for `PyEval_InitThreads` (GH-100667)
(cherry picked from commit 254ab42240)

Co-authored-by: Alexander Shadchin <alexandr.shadchin@gmail.com>
2023-01-02 03:21:20 -08:00
Miss Islington (bot) 4b3b6423c3
gh-98712: Clarify "readonly bytes-like object" semantics in C arg-parsing docs (GH-98710)
(cherry picked from commit 49f6ff719c)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-12-23 07:08:11 -08:00
Miss Islington (bot) bf0a334c4e
Docs: Use `PY_VERSION_HEX` for version comparison (GH-100179)
(cherry picked from commit 0264f634f7)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-12-16 23:49:49 -08:00
Miss Islington (bot) 370498b12e
gh-97909: Fix markup for `PyMethodDef` members (GH-100089)
(cherry picked from commit 8edcb30c3f)

Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
2022-12-16 23:19:45 -08:00
Miss Islington (bot) 5dce4ab736
gh-99249: Clarify "read-only" slots tp_bases & tp_mro (GH-99342)
These slots are marked "should be treated as read-only" in the
table at the start of the document.  That doesn't say anything about
setting them in the static struct.

`tp_bases` docs did say that it should be ``NULL`` (TIL!). If you
ignore that, seemingly nothing bad happens. However, some slots
may not be inherited, depending on which sub-slot structs are present.
(FWIW, NumPy sets tp_bases and is affected by the quirk -- though to
be fair, its DUAL_INHERIT code probably predates tp_bases docs, and
also the result happens to be benign.)

This patch makes things explicit.
It also makes the summary table legend easier to scan.

(cherry picked from commit 219696abb2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-11-28 03:25:04 -08:00
Miss Islington (bot) 9a4b2f4f7f
gh-93937: Document PyFrame_Check and PyFrame_Type (GH-99695)
(cherry picked from commit d15b9f19ac)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-11-22 07:50:39 -08:00
Miss Islington (bot) 369cb3e66a
Doc: Replace question mark with fullstop (GH-99558)
The sentence "Set the LC_CTYPE locale to the user preferred locale." should end with a period
instead of a question mark.
(cherry picked from commit 0e09d2cc59)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2022-11-18 11:34:10 -08:00
Miss Islington (bot) 857f6a44a5
[3.11] gh-96746: Docs: Clear up Py_TPFLAGS_DISALLOW_INSTANTIATION inheritance (GH-99002) (GH-99212)
gh-96746: Docs: Clear up Py_TPFLAGS_DISALLOW_INSTANTIATION inheritance (GH-99002)

The flag is not inherited, but its effect -- a NULL tp_new -- is.

Drop hints for people who come here wanting to “disallow instantiation”.
(cherry picked from commit 1438b77997)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-11-07 19:55:58 +01:00
Miss Islington (bot) 88736db5d6
gh-96997: Clarify the contract of PyMem_SetAllocator() (GH-98977)
(cherry picked from commit c053284e39)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-11-02 14:57:26 -07:00
Hugo van Kemenade 095e06f4ca
[3.11] Docs: Bump sphinx-lint and use double backticks for inline literals (GH-98441) (#98445)
Bump sphinx-lint and use double backticks for inline literals
2022-10-20 06:07:33 -07:00
C.A.M. Gerlach ea19c28512
[3.11] Docs: Fix backtick errors found by sphinx-lint (GH-97998) (#98371)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>.
(cherry picked from commit fa2d43e518)

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

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-10-18 01:49:38 +02:00
Miss Islington (bot) 4172e09c3a
Fix types in buffer/memoryview docs (GH-98118)
The definition of obj in the `Py_buffer` struct is as a PyObject*
ec091bd47e/Include/pybuffer.hGH-L22

PyMemoryView_GET_BASE returns `.obj` - thus its return type
should be a PyObject* (or at least a void*). It definitely
doesn't return `Py_buffer`
(cherry picked from commit c459fedf7c)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2022-10-09 18:03:53 -07:00
Miss Islington (bot) 0a84b7aa4d
Add a warning message about PyOS_snprintf (GH-95993)
(cherry picked from commit c7b2204996)

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
2022-10-07 13:26:46 -07:00
Miss Islington (bot) 27a7fe319a
[3.11] gh-93738: Disallow pre-v3 syntax in the C domain (GH-97962) (#97976)
Also, disable using invalid sphinx-lint 0.6.2.
(cherry picked from commit f612565bd3)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-10-06 10:49:29 -07:00
Łukasz Langa 83ad76275c
[3.11] gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (GH-97768) (#97924)
:c:type:`<C type>` -> :c:expr:`<C type>`

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 0031e62973)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-05 14:11:12 -07:00
Miss Islington (bot) 92054dfe5d
[3.11] gh-93738: Documentation C syntax (Function glob patterns -> literal markup) (GH-97774) (#97910)
(cherry picked from commit 0e72606dd4)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-10-05 11:00:29 -07:00
Miss Islington (bot) 5c8aa2e0f2
[3.11] gh-93738: Documentation C syntax (:c:type:`PyTypeObject*` -> :c:expr:`PyTypeObject*`) (GH-97778) (#97892)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit c70c8b6976)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-05 08:21:32 -07:00
Miss Islington (bot) d5852a090f
[3.11] gh-93738: Documentation C syntax (Use `c:struct`) (GH-97772) (#97869)
Use `c:struct`
(cherry picked from commit a0f5599aac)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-05 08:20:03 -07:00
Miss Islington (bot) ffafd31975
[3.11] gh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. cases) (GH-97775) (#97873)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-05 08:18:55 -07:00
Miss Islington (bot) 0a2008037f
[3.11] gh-93738: Documentation C syntax (:c:type:`PyObject` -> :c:expr:`PyObject`) (GH-97776) (#97889)
:c:type:`PyObject` -> :c:expr:`PyObject`
(cherry picked from commit 0bf6a617ed)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-05 08:18:27 -07:00
Miss Islington (bot) 98e250bed1
[3.11] gh-93738: Documentation C syntax (:c:data:`view->obj` -> :c:expr:`view->obj`) (GH-97773) (#97867)
:c:data:`view->obj` -> :c:expr:`view->obj`
(cherry picked from commit fa59bda8d3)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-04 17:55:17 -07:00
Miss Islington (bot) 76c50d784f
[3.11] gh-93738: Documentation C syntax (:c:type:`PyInterpreterState *` -> :c:expr:`PyInterpreterState *`) (GH-97777) (#97865)
:c:type:`PyInterpreterState *` -> :c:expr:`PyInterpreterState *`
(cherry picked from commit 4ebb025031)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-04 17:53:48 -07:00
Miss Islington (bot) 3ec11d92fd
[3.11] gh-93738: Documentation C syntax (:c:type:`TYPE` -> :c:expr:`TYPE`) (GH-97770) (#97874)
:c:type:`TYPE` -> :c:expr:`TYPE`
(cherry picked from commit 8b211b4cdb)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-04 17:48:24 -07:00
Miss Islington (bot) 1b7da7f088
[3.11] gh-93738: Documentation C syntax (:c:type:`FILE` -> :c:expr:`FILE`) (GH-97769) (#97871)
:c:type:`FILE` -> :c:expr:`FILE`
(cherry picked from commit 192d401ba5)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-04 17:47:02 -07:00
Miss Islington (bot) a51124729a
[3.11] gh-93738: Documentation C syntax (:c:type:`PyTupleObject*` -> :c:expr:`PyTupleObject*`) (GH-97780) (#97863)
:c:type:`PyTupleObject*` -> :c:expr:`PyTupleObject*`
(cherry picked from commit 510baa429a)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-04 16:46:13 -07:00
Miss Islington (bot) df133f54ef
[3.11] gh-93738: Documentation C syntax (:c:type:`PyBytesObject*` -> :c:expr:`PyBytesObject*`) (GH-97782) (#97861)
:c:type:`PyBytesObject*` -> :c:expr:`PyBytesObject*`
(cherry picked from commit 9ebc50866b)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-04 16:40:47 -07:00
Miss Islington (bot) 9749c6029e
[3.11] gh-93738: Documentation C syntax (:c:type:`PyUnicodeObject*` -> :c:expr:`PyUnicodeObject*`) (GH-97783) (#97859)
:c:type:`PyUnicodeObject*` -> :c:expr:`PyUnicodeObject*`
(cherry picked from commit 898834e27b)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-04 16:38:58 -07:00
Miss Islington (bot) e34b00cc3e
gh-93738: Documentation C syntax (:c:data:`0` -> ``0``) (GH-97771)
:c:data:`0` -> ``0``
(cherry picked from commit 5e997cff3e)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-10-03 18:55:04 -07:00
Miss Islington (bot) 58247c5b86
gh-95913: Fix and copyedit New Features section of 3.11 What's New (GH-95915)
(cherry picked from commit 8ee27e3318)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-09-19 06:45:35 -07:00
Miss Islington (bot) 53a344ef80
Doc: Update Py_TPFLAGS_HAVE_FINALIZE in docs (GH-96273)
It is now deprecated and the docs should reflect that.
(cherry picked from commit 9625de6fab)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2022-08-30 01:38:40 -07:00
Miss Islington (bot) 3d14b4fecb
Clarify API stability of PyTypeObject in relation to static types. (GH-96217)
Fixes:
https://github.com/python/cpython/issues/95300

Related:
https://github.com/python/cpython/issues/91271
(cherry picked from commit caa2a9799a)

Co-authored-by: ov2k <ov2k.github@gmail.com>
2022-08-25 06:42:14 -07:00
Miss Islington (bot) c96b26cb06
GH-92678: Document that you shouldn't be doing your own dictionary offset calculations. (GH-95598) (GH-95821)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Mark Shannon <mark@hotpy.org>
2022-08-09 16:22:54 +01:00
Miss Islington (bot) f2926358d1
gh-94936: C getters: co_varnames, co_cellvars, co_freevars (GH-95008)
(cherry picked from commit 42b102bbf9)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2022-08-04 07:16:52 -07:00
Dong-hee Na 0a51204cd0
[3.11] gh-90359: Unify documentation style for datetime.rst (gh-94836) (gh-94838)
(cherry picked from commit 967da5febb)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-07-14 09:52:53 +09:00
Miss Islington (bot) c473627c73
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:09 -07:00
Miss Islington (bot) 77bf973930
Docs: remove redundant "adverb-adjective" hyphens from compound modifiers (GH-94551) (GH-94557)
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:19 +02:00
Irit Katriel ad23df97ed
[3.11] [doc] fix typo in reference to tp_descr_get and tp_descr_set (GH-94140) (GH-94293)
(cherry picked from commit 32d595fdcd)

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>

Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
2022-06-26 11:11:19 +01:00
Miss Islington (bot) 25444124e3
gh-87961: Remove outdated notes from functions that aren't in the Limited 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 2c3fe5eeb2)

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

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-06-09 16:15:33 +02:00
Miss Islington (bot) fc31e2de3c
gh-92913: Fix typos in documentation (GH-93129)
(cherry picked from commit 6a6f823ea7)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-05-23 09:54:36 -07:00
Miss Islington (bot) 4eb2f40756
gh-92913: Clarify changes to PyInitConfig.module_search_paths[_set] fields (GH-92980)
(cherry picked from commit 403d16fa28)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-05-19 13:13:15 -07:00
Miss Islington (bot) fad72d0e36
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:22 -07:00
Miss Islington (bot) 0c1795bd33
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:05 -07:00
Miss Islington (bot) 6e1a214426
gh-89653: PEP 670: unicodeobject.h uses _Py_CAST() (GH-92696) (GH-92703)
Use _Py_CAST() and _Py_STATIC_CAST() in macros wrapping static inline
functions of unicodeobject.h.

Change also the kind type from unsigned int to int: same parameter
type than PyUnicode_FromKindAndData().

The limited API version 3.11 no longer casts arguments to expected
types.
(cherry picked from commit d0c9353a79)

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-12 02:01:35 +02:00
Miss Islington (bot) ea58fea818
Enhance PyConfig documentation (GH-92394)
(cherry picked from commit 7b9803f93f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-05-09 03:51:11 -07:00
Miss Islington (bot) be6c89cf26
[3.11] GH-92431: Fix footnotes in Doc/c-api/exceptions.rst (GH-92432) (GH-92469)
* 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:56 -07:00
Matt Wozniski 740da8d37a
Document the lifetime of `PyUnicode_AsUTF8String` (#92325)
The current wording implied this, but didn't state it explicitly.
2022-05-06 10:37:08 +01:00
Victor Stinner 299692afd8
gh-88279: Deprecate PySys_SetArgvEx() (#92363)
Deprecate the following C functions:

* PySys_SetArgv()
* PySys_SetArgvEx()
* PySys_SetPath()
2022-05-06 05:24:29 +02:00
Victor Stinner ada8b6d1b1
gh-57684: Add -P cmdline option and PYTHONSAFEPATH env var (#31542)
Add the -P command line option and the PYTHONSAFEPATH environment
variable to not prepend a potentially unsafe path to sys.path.

* Add sys.flags.safe_path flag.
* Add PyConfig.safe_path member.
* Programs/_bootstrap_python.c uses config.safe_path=0.
* Update subprocess._optim_args_from_interpreter_flags() to handle
  the -P command line option.
* Modules/getpath.py sets safe_path to 1 if a "._pth" file is
  present.
2022-05-06 01:34:11 +02:00
Robert Howlett 43b135f94e
gh-92047: Py_GetVersion multi-digit minor version (GH-92047) (#92048) 2022-05-05 11:33:35 +02:00
Victor Stinner 2eca5dad0a
gh-89653: PEP 670: Convert PyBytes macros to functions (#91990)
Convert the following macros to static inline functions:

* PyByteArray_AS_STRING()
* PyByteArray_GET_SIZE()
* PyBytes_AS_STRING()
* PyBytes_GET_SIZE()

Limited C API version 3.11 no longer casts arguments.

Add _PyBytes_CAST() and _PyByteArray_CAST() macros.
2022-05-03 20:14:58 +02:00
Ken Jin 6c7249f265
gh-92154: Expose PyCode_GetCode in the C API (GH-92168) 2022-05-03 21:13:13 +08:00
Victor Stinner 6811bdef63
gh-88097: doc: fix link to Py_Version (#92141) 2022-05-02 15:29:22 +02:00
Erlend Egeberg Aasland 1218061609
gh-89653: PEP 670: Amend docs (GH-91813) 2022-04-22 14:59:18 +02:00
Petr Viktorin 82ec638ab7
Docs: Clarify availability of PyOS_CheckStack (GH-91816) 2022-04-22 12:44:43 +02:00
Victor Stinner eaa85cb22f
gh-91768: C API no longer use "const PyObject*" type (#91769)
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.
2022-04-21 22:07:19 +02:00
Mark Shannon d44815cabc
GH-88116: Document that PyCodeNew is dangerous, and make PyCode_NewEmpty less dangerous. (GH-91790) 2022-04-21 19:08:36 +01:00
Mark Shannon 5974827c71
GH-88756: Update docs for PEP 523 eval function type. (GH-91788) 2022-04-21 18:14:01 +01:00
Victor Stinner aa5c0a9f8d
bpo-40421: Cleanup PyFrame C API (GH-32417) 2022-04-19 09:53:10 +02:00
Oleg Iarygin a573cb2fec
gh-91118: Fix docstrings that do not honor --without-doc-strings (#31769)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-17 20:39:32 -07:00
Irit Katriel 5d421d7342
gh-90501: Add PyErr_GetHandledException and PyErr_SetHandledException (GH-30531) 2022-04-15 19:57:47 +01:00
Mark Shannon 5b4a4b6f09
Add new PyFrame_GetLasti C-API function (GH-32413) 2022-04-08 12:18:57 +01:00
Jelle Zijlstra 4c92427fb8
c-api docs: There are five fields, not four (GH-32379) 2022-04-07 07:02:54 -07:00
Petr Viktorin d79f118d04
bpo-47115: Document which parts of structs are in limited API/stable ABI (GH-32196)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2022-04-06 16:50:45 +02:00
Victor Stinner 2b4f2f5fa4
Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)" (GH-32343)
* Revert "bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)"

This reverts commit f877b40e3f.

* Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)"

This reverts commit b9a5522dd9.
2022-04-06 13:58:07 +02:00
Jelle Zijlstra 677a879466
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
2022-04-02 12:32:59 -07:00
Jelle Zijlstra 897bc6f928
More minor fixes to C API docs (GH-31525)
* 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
2022-04-02 12:31:05 -07:00
Victor Stinner f877b40e3f
bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)
Move the private _PyFrameEvalFunction type, and private
_PyInterpreterState_GetEvalFrameFunc() and
_PyInterpreterState_SetEvalFrameFunc() functions to the internal C
API. The _PyFrameEvalFunction callback function type now uses the
_PyInterpreterFrame type which is part of the internal C API.

Update the _PyFrameEvalFunction documentation.
2022-04-01 10:55:00 +02:00
Mark Shannon 74b95d86e0
bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114) 2022-03-31 17:13:25 +01:00
Victor Stinner f0bc694856
bpo-47164: Add _PyCFunction_CAST() macro (GH-32192)
Use the macro in C files of the Python/ directory.
2022-03-31 10:02:34 +02:00
Hugo van Kemenade 6881ea936e
bpo-47126: Update to canonical PEP URLs specified by PEP 676 (GH-32124) 2022-03-30 12:00:27 +01:00
Mark Shannon d7163bb35d
bpo-42197: Don't create `f_locals` dictionary unless we actually need it. (GH-32055)
* `PyFrame_FastToLocalsWithError` and `PyFrame_LocalsToFast` are no longer called during profile and tracing.
 (Contributed by Fabio Zadrozny)

* Make accesses to a frame's `f_locals` safe from C code, not relying on calls to `PyFrame_FastToLocals` or `PyFrame_LocalsToFast`.

* Document new `PyFrame_GetLocals` C-API function.
2022-03-25 12:57:50 +00:00
Victor Stinner b0f886d1bc
bpo-46836: Add Doc/c-api/frame.rst (GH-32051)
Reorganize the documentation of the PyFrameObject C API.
2022-03-23 13:19:13 +01:00