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>
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>
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>
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>
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)
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>
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>
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>
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>
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>
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>
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>