cpython/Doc/includes
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
..
custom.c gh-91118: Fix docstrings that do not honor --without-doc-strings (#31769) 2022-04-17 20:39:32 -07:00
custom2.c gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h (GH-99014) 2022-11-22 08:25:43 +01:00
custom3.c gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h (GH-99014) 2022-11-22 08:25:43 +01:00
custom4.c gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h (GH-99014) 2022-11-22 08:25:43 +01:00
dbpickle.py
diff.py gh-97669: Move difflib examples to Doc/includes/ (#97964) 2022-10-07 10:57:48 -07:00
email-alternative.py Update Email library documentation example (GH-3720) 2017-09-24 09:12:53 -07:00
email-dir.py bpo-38351: Modernize email examples from %-formatting to f-strings (GH-17162) 2019-11-15 11:03:46 +02:00
email-headers.py gh-84623: Remove unused imports (#94132) 2022-06-22 19:14:27 +02:00
email-mime.py gh-91520: Rewrite imghdr inlining for clarity and completeness (#91521) 2022-04-14 17:48:59 -07:00
email-read-alternative.py gh-82530: Create blank function instead of invalid import for email example (#97529) 2022-09-26 00:06:11 -04:00
email-simple.py bpo-38351: Modernize email examples from %-formatting to f-strings (GH-17162) 2019-11-15 11:03:46 +02:00
email-unpack.py bpo-38351: Modernize email examples from %-formatting to f-strings (GH-17162) 2019-11-15 11:03:46 +02:00
minidom-example.py Update old-style strings to f-strings (GH-30384) 2022-01-04 01:25:56 -08:00
mp_newtype.py
mp_pool.py
mp_workers.py
ndiff.py gh-97669: Move difflib examples to Doc/includes/ (#97964) 2022-10-07 10:57:48 -07:00
run-func.c Doc: define PY_SSIZE_T_CLEAN always (GH-12794) 2019-04-13 10:46:21 +09:00
setup.py doc: fix compile error on "shoddy" example extension (GH-215) 2017-02-21 21:51:46 +09:00
sublist.c gh-91118: Fix docstrings that do not honor --without-doc-strings (#31769) 2022-04-17 20:39:32 -07:00
test.py bpo-33201: Modernize "Extension types" doc (GH-6337) 2018-04-07 18:14:03 +02:00
turtle-star.py
typestruct.h bpo-43908: Document Static Types in the C API (GH-25710) 2021-04-29 10:26:34 +02:00
tzinfo_examples.py gh-96959: Update HTTP links which are redirected to HTTPS (#98039) 2022-10-07 11:52:45 -07:00
wasm-notavail.rst gh-95451: Update docs for wasm32-emscripten and -wasi platforms (GH-95452) 2022-08-02 21:00:41 +02:00