Commit graph

22 commits

Author SHA1 Message Date
Adam Turner e97b7bef4f
GH-92584: Remove distutils from the newtypes tutorial includes (#108024) 2023-08-22 20:42:51 +02:00
Serhiy Storchaka 983305268e
gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) 2023-07-27 18:44:32 +03:00
Serhiy Storchaka d363eb5b02
gh-107091: Fix some uses of :attr: role (GH-107318)
Fix also formatting of PyMethodDef members.
2023-07-27 08:52:54 +03:00
Victor Stinner 8d61a71f9c
gh-107298: Fix more Sphinx warnings in the C API doc (#107329)
Declare the following functions as macros, since they are actually
macros. It avoids a warning on "TYPE" or "macro" argument.

* PyMem_New()
* PyMem_Resize()
* PyModule_AddIntMacro()
* PyModule_AddStringMacro()
* PyObject_GC_New()
* PyObject_GC_NewVar()
* PyObject_New()
* PyObject_NewVar()

Add C standard C types to nitpick_ignore in Doc/conf.py:

* int64_t
* uint64_t
* uintptr_t

No longer ignore non existing "__int" type in nitpick_ignore.

Update Doc/tools/.nitignore
2023-07-27 00:52:40 +00:00
Victor Stinner 87b39028e5
gh-107298: Fix doc references to undocumented modules (#107300)
Update also Doc/tools/.nitignore.
2023-07-26 18:59:06 +02:00
Serhiy Storchaka 329e4a1a3f
gh-86493: Modernize modules initialization code (GH-106858)
Use PyModule_Add() or PyModule_AddObjectRef() instead of soft deprecated
PyModule_AddObject().
2023-07-25 14:34:49 +03:00
Serhiy Storchaka fcc816dbff
gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920) 2023-07-21 10:52:07 +03:00
Jeffrey Newman 23cf1e20a6
gh-99202: Fix extension type from documentation for compiling in C++20 mode (#102518) 2023-04-06 17:59:36 +02:00
Petr Viktorin 4d82f628c4
gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h (GH-99014)
The ``structmember.h`` header is deprecated, though it continues to be available
and there are no plans to remove it. There are no deprecation warnings. Old code
can stay unchanged (unless the extra include and non-namespaced macros bother
you greatly). Specifically, no uses in CPython are updated -- that would just be
unnecessary churn.
The ``structmember.h`` header is deprecated, though it continues to be
available and there are no plans to remove it.

Its contents are now available just by including ``Python.h``,
with a ``Py`` prefix added if it was missing:

- `PyMemberDef`, `PyMember_GetOne` and`PyMember_SetOne`
- Type macros like `Py_T_INT`, `Py_T_DOUBLE`, etc.
  (previously ``T_INT``, ``T_DOUBLE``, etc.)
- The flags `Py_READONLY` (previously ``READONLY``) and
  `Py_AUDIT_READ` (previously all uppercase)

Several items are not exposed from ``Python.h``:

- `T_OBJECT` (use `Py_T_OBJECT_EX`)
- `T_NONE` (previously undocumented, and pretty quirky)
- The macro ``WRITE_RESTRICTED`` which does nothing.
- The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of
  `Py_AUDIT_READ`.
- In some configurations, ``<stddef.h>`` is not included from ``Python.h``.
  It should be included manually when using ``offsetof()``.

The deprecated header continues to provide its original
contents under the original names.
Your old code can stay unchanged, unless the extra include and non-namespaced
macros bother you greatly.

There is discussion on the issue to rename `T_PYSSIZET` to `PY_T_SSIZE` or
similar. I chose not to do that -- users will probably copy/paste that with any
spelling, and not renaming it makes migration docs simpler.


Co-Authored-By: Alexander Belopolsky <abalkin@users.noreply.github.com>
Co-Authored-By: Matthias Braun <MatzeB@users.noreply.github.com>
2022-11-22 08:25:43 +01:00
Adam Turner f612565bd3
gh-93738: Disallow pre-v3 syntax in the C domain (#97962)
Also, disable using invalid sphinx-lint 0.6.2.
2022-10-06 10:11:37 -07: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
rtobar b275267aa7
bpo-45790: List macros in same order in which fields are described (GH-29529)
Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-04 19:36:33 -07:00
Victor Stinner a41782cc84
bpo-43774: Document configure options (GH-25283)
Add Doc/using/configure.rst documentation to document configure,
preprocessor, compiler and linker options.

Add a new section about the "Python debug build".
2021-04-08 22:32:21 +02:00
Victor Stinner bb0b08540c
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.
2020-08-14 12:20:05 +02:00
Serhiy Storchaka 25fc088607
bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950)
Replace all *NULL* with ``NULL``.
2019-10-30 12:03:20 +02:00
Krishna Oza 038503e08a bpo-38391: Fixing a typo for Py_DECREF (GH-16616) 2019-10-07 19:57:45 +08:00
Brandt Bucher 224b8aaa7e bpo-26868: Fix example usage of PyModule_AddObject. (#15725)
* Add a note to the PyModule_AddObject docs.

* Correct example usages of PyModule_AddObject.

* Whitespace.

* Clean up wording.

* 📜🤖 Added by blurb_it.

* First code review.

* Add < 0 in the tests with PyModule_AddObject
2019-09-12 13:11:20 +01:00
Stéphane Wirtel cbb6484573 Doc: Replace the deprecated highlightlang directive by highlight. (#13377)
highlightlang is deprecated since April 2018 in Sphinx.
See https://github.com/sphinx-doc/sphinx/pull/4845
2019-05-17 15:25:34 +05:30
Wu Wei 662ebd2ab2 Doc: add the missing ".tp_flags" in type definition (GH-12902) 2019-04-22 20:08:20 +09:00
Siddhesh Poyarekar 55edd0c185 bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030)
METH_NOARGS functions need only a single argument but they are cast
into a PyCFunction, which takes two arguments.  This triggers an
invalid function cast warning in gcc8 due to the argument mismatch.
Fix this by adding a dummy unused argument.
2018-04-29 21:59:33 +03:00
Serhiy Storchaka 46936d5a71
Improve highlighting of some code blocks. (GH-6401) 2018-04-08 19:18:04 +03:00
Antoine Pitrou 1d80a56173
bpo-33201: Modernize "Extension types" doc (GH-6337)
* bpo-33201: Modernize "Extension types" doc
* Split tutorial and other topics
* Some small fixes
* Address some review comments
* Rename noddy* to custom* and shoddy to sublist
* Fix markup
2018-04-07 18:14:03 +02:00