cpython/Lib
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
..
__phello__ bpo-45020: Add more test cases for frozen modules. (gh-28664) 2021-09-30 18:38:52 -06:00
asyncio GH-99388: add loop_factory parameter to asyncio.run (#99462) 2022-11-14 10:18:51 -08:00
collections GH-98766: Modest speed-up from ChainMap.__iter__ (GH-98946) 2022-10-31 23:44:40 -05:00
concurrent gh-95166: cancel map waited on future on timeout (GH-95169) 2022-07-28 11:20:10 +02:00
ctypes gh-92869: ctypes: Add c_time_t (#92870) 2022-07-03 11:58:02 -07:00
curses bpo-44712: Replace "type(literal)" with corresponding builtin types (GH-27294) 2022-05-08 17:10:11 +03:00
dbm bpo-40563: Support pathlike objects on dbm/shelve (GH-21849) 2021-09-10 15:26:16 +03:00
email gh-95087: Fix IndexError in parsing invalid date in the email module (GH-95201) 2022-07-25 09:17:25 +03:00
encodings gh-98433: Fix quadratic time idna decoding. (#99092) 2022-11-07 16:54:41 -08:00
ensurepip gh-99134: Update bundled pip to 22.3.1 (gh-99135) 2022-11-05 17:50:39 +00:00
html gh-97669: Create Tools/build/ directory (#97963) 2022-10-17 12:01:00 +02:00
http gh-94172: Remove keyfile, certfile and check_hostname parameters (#94173) 2022-11-03 18:32:25 +01:00
idlelib bpo-33964: IDLE macosx - removed unused local dict. (GH-7926) 2022-11-06 20:10:22 +00:00
importlib gh-99254: remove all unused consts from code objects (GH-99255) 2022-11-11 10:53:43 +00:00
json gh-96959: Update HTTP links which are redirected to HTTPS (GH-96961) 2022-09-24 14:38:53 +03:00
lib2to3 gh-54781: Move Lib/lib2to3/tests/ to Lib/test/test_lib2to3/ (#94049) 2022-06-21 15:21:22 +02:00
logging gh-98307: Add docstring and documentation for SysLogHandler.createSocket (GH-98319) 2022-10-16 09:15:46 +01:00
msilib gh-91217: deprecate msilib (GH-91515) 2022-04-14 12:50:11 -07:00
multiprocessing gh-61460: Add a comment describing the multiprocessing.connection protocol (gh-99623) 2022-11-20 10:20:04 -08:00
pydoc_data Python 3.12.0a2 2022-11-14 12:18:11 +01:00
re gh-91524: Speed up the regular expression substitution (#91525) 2022-10-23 15:57:30 -07:00
site-packages
sqlite3 gh-95273: Improve sqlite3.complete_statement docs (#95840) 2022-08-12 01:05:12 +02:00
test gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h (GH-99014) 2022-11-22 08:25:43 +01:00
tkinter gh-97928: Fix handling options starting with "-" in tkinter.Text.count() (GH-98436) 2022-10-19 12:30:14 +03:00
tomllib bpo-40059: Add tomllib (PEP-680) (GH-31498) 2022-03-08 09:26:13 +01:00
turtledemo gh-91212: Fixed flickering when the tracer is turned off (#95129) 2022-09-28 23:40:51 -07:00
unittest gh-98086: Now `patch.dict` can decorate async functions (#98095) 2022-11-11 08:04:30 +00:00
urllib gh-99418: Make urllib.parse.urlparse enforce that a scheme must begin with an alphabetical ASCII character. (#99421) 2022-11-13 10:25:55 -08:00
venv gh-98741: Remove useless check_home usage from is_python_build usage (GH-98743) 2022-10-26 22:40:47 +01:00
wsgiref gh-92886: Replace assertion statements in handlers.BaseHandler to support running with optimizations (-O) (GH-93231) 2022-10-19 11:38:59 +01:00
xml gh-96175: add missing self._localName assignment in xml.dom.minidom.Attr (#96176) 2022-08-23 09:16:02 -07:00
xmlrpc bpo-44712: Replace "type(literal)" with corresponding builtin types (GH-27294) 2022-05-08 17:10:11 +03:00
zoneinfo bpo-46124: Update zoneinfo to rely on importlib.resources traversable API. (GH-30190) 2022-01-21 13:18:31 -08:00
__future__.py gh-93626: Set the release for __future__.annotations to None (GH-93628) 2022-07-05 10:46:39 +02:00
__hello__.py bpo-47084: Clear Unicode cached representations on finalization (GH-32032) 2022-03-22 13:53:51 +01:00
_aix_support.py gh-92584: Remove references to removed _bootsubprocess (#99062) 2022-11-03 18:12:45 +01:00
_collections_abc.py Add notes for maintaining ABCs (#92736) 2022-05-12 13:18:39 -05:00
_compat_pickle.py bpo-46565: del loop vars that are leaking into module namespaces (GH-30993) 2022-02-03 11:20:08 +02:00
_compression.py bpo-41486: Faster bz2/lzma/zlib via new output buffering (GH-21740) 2021-04-27 23:58:54 -07:00
_markupbase.py
_osx_support.py [codemod] Fix non-matching bracket pairs (GH-28473) 2021-09-22 01:09:00 +02:00
_py_abc.py
_pydecimal.py gh-91291: Accept attributes as keyword arguments in decimal.localcontext (#32242) 2022-04-21 21:27:15 -07:00
_pyio.py gh-98999: Raise ValueError in _pyio on closed buffers (gh-99009) 2022-11-03 12:03:12 +09:00
_pylong.py gh-90716: Remove _pylong._DEBUG flag (#99063) 2022-11-03 18:16:28 +01:00
_sitebuiltins.py bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25189) 2021-04-06 11:18:41 +09:00
_strptime.py
_threading_local.py
_weakrefset.py bpo-26579: Add object.__getstate__(). (GH-2821) 2022-04-06 20:00:14 +03:00
abc.py bpo-43827: Make arguments to abc.ABCMeta.__new__ pos-only (#25385) 2022-05-05 06:40:01 -07:00
aifc.py gh-47061: Deprecate chunk (GH-91419) 2022-04-11 15:02:41 -07:00
antigravity.py
argparse.py gh-80448: argparse: Fix IndexError on store_true action (#15656) 2022-11-11 17:51:38 -08:00
ast.py gh-95588: Drop the safety claim from ast.literal_eval docs. (#95919) 2022-10-01 17:55:40 -07:00
base64.py gh-93096: Remove python -m base64 -t (gh-94230) 2022-07-02 15:53:43 +09:00
bdb.py bpo-30419: DOC: Update missing information in bdb docs (#1687) 2022-09-02 13:22:42 -04:00
bisect.py
bz2.py bpo-45475: Revert __iter__ optimization for GzipFile, BZ2File, and LZMAFile. (GH-29016) 2021-10-19 11:51:48 +09:00
calendar.py bpo-46659: Enhance LocaleTextCalendar for C locale (GH-31214) 2022-02-24 14:29:08 +01:00
cgi.py bpo-47061: deprecate cgi and cgitb (GH-32410) 2022-04-08 17:15:35 -07:00
cgitb.py bpo-44712: Replace "type(literal)" with corresponding builtin types (GH-27294) 2022-05-08 17:10:11 +03:00
chunk.py gh-47061: Deprecate chunk (GH-91419) 2022-04-11 15:02:41 -07:00
cmd.py gh-67248: cmd: Sort miscellaneous help topics (#92254) 2022-05-03 21:36:52 -06:00
code.py
codecs.py gh-51511: Note that codecs.open()'s encoding parameter affects automatic conversion to binary mode (#94370) 2022-10-21 16:01:05 -07:00
codeop.py gh-96052: codeop: fix handling compiler warnings in incomplete input (GH-96132) 2022-09-16 17:37:30 +03:00
colorsys.py Improve consistency of colorsys.rgb_to_hsv (GH-27277) 2021-07-23 09:59:30 -03:00
compileall.py Fixed documentation typo in compileall.py (GH-29912) 2021-12-05 00:38:17 +09:00
configparser.py gh-89336: Remove configparser APIs that were deprecated for 3.12 (#92503) 2022-06-21 14:31:25 -07:00
contextlib.py gh-96348: Deprecate the 3-arg signature of coroutine.throw and generator.throw (GH-96428) 2022-09-30 09:43:02 +01:00
contextvars.py
copy.py gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609) 2022-06-09 10:12:43 +03:00
copyreg.py gh-99325: Remove unused NameError handling (#99326) 2022-11-11 09:56:57 +00:00
cProfile.py gh-65961: Do not rely solely on __cached__ (GH-97990) 2022-10-06 15:40:22 -07:00
crypt.py gh-95231: Disable md5 & crypt modules if FIPS is enabled (GH-94742) 2022-08-15 07:48:07 -07:00
csv.py gh-99281: [csv] remove try/except, complex always exists (#99282) 2022-11-10 10:37:57 +00:00
dataclasses.py gh-96151: Use a private name for passing builtins to dataclass. This now allows for a field named BUILTIN (gh-98143) 2022-10-31 08:31:01 -04:00
datetime.py gh-98378: Add small format string example to strftime comments (GH-98379) 2022-10-18 06:42:10 -07:00
decimal.py
difflib.py Correct method name typo (#91970) 2022-04-27 15:28:56 -06:00
dis.py GH-98686: Get rid of "adaptive" and "quick" instructions (GH-99182) 2022-11-09 10:50:09 -08:00
doctest.py bpo-28249: fix lineno location for empty DocTest instances (GH-30498) 2022-05-19 17:46:15 +02:00
enum.py gh-92647: [Enum] use final status to determine lookup or create (GH-99500) 2022-11-15 08:49:22 -08:00
filecmp.py gh-93991: Use boolean instead of 0/1 for condition check (GH-93992) 2022-06-19 07:12:59 -07:00
fileinput.py gh-93157: Fix fileinput didn't support errors in inplace mode (GH-95128) 2022-07-24 11:42:11 +09:00
fnmatch.py gh-89973: Fix re.error in the fnmatch module. (GH-93072) 2022-06-05 11:46:29 +03:00
fractions.py GH-96465: Cache hashes for Fraction instances (GH-96483) 2022-09-07 10:31:50 -05:00
ftplib.py gh-94172: Remove keyfile, certfile and check_hostname parameters (#94173) 2022-11-03 18:32:25 +01:00
functools.py gh-89828: Do not relay the __class__ attribute in GenericAlias (#93754) 2022-06-18 11:34:57 +03:00
genericpath.py
getopt.py bpo-44712: Replace "type(literal)" with corresponding builtin types (GH-27294) 2022-05-08 17:10:11 +03:00
getpass.py update docstring for win_getpass to reflect code changes (GH-24967) 2021-05-03 23:48:29 -07:00
gettext.py bpo-44235: Remove deprecated functions in the gettext module. (GH-26378) 2021-05-30 10:29:45 +09:00
glob.py bpo-37578: glob.glob -- added include_hidden parameter (GH-30153) 2021-12-18 06:23:34 -08:00
graphlib.py bpo-45359: Support TopologicalSorter type subscript (GH-28714) 2021-12-08 20:52:57 +02:00
gzip.py gh-95534: Improve gzip reading speed by 10% (#97664) 2022-10-16 19:10:58 -07:00
hashlib.py gh-94199: Remove hashlib.pbkdf2_hmac() Python implementation (GH-94200) 2022-06-28 11:51:13 +02:00
heapq.py Update: usage doc for heappushpop (GH-91451) 2022-04-17 23:12:33 -05:00
hmac.py
imaplib.py gh-94172: Remove keyfile, certfile and check_hostname parameters (#94173) 2022-11-03 18:32:25 +01:00
imghdr.py gh-85455: Add missing doc strings and improve docs (#21573) 2022-10-15 09:31:06 -04:00
imp.py bpo-45019: Do some cleanup related to frozen modules. (gh-28319) 2021-09-13 16:18:37 -06:00
inspect.py gh-74044: inspect.signature for wrappers around decorated bound methods (GH-736) 2022-11-10 12:32:01 +00:00
io.py gh-94169: Remove deprecated io.OpenWrapper (#94170) 2022-06-24 08:46:53 +02:00
ipaddress.py bpo-46415: Use f-string for ValueError in ipaddress.ip_{address,network,interface} helper functions (#30642) 2022-05-03 06:12:58 -06:00
keyword.py
linecache.py gh-92336: linecache.getline should not raise exceptions on decoding errors (GH-94410) 2022-06-30 10:18:18 +01:00
locale.py gh-94226: Remove the locale.format() function (#94229) 2022-06-26 12:41:19 +02:00
lzma.py bpo-45475: Revert __iter__ optimization for GzipFile, BZ2File, and LZMAFile. (GH-29016) 2021-10-19 11:51:48 +09:00
mailbox.py
mailcap.py gh-68966: Make mailcap refuse to match unsafe filenames/types/params (GH-91993) 2022-06-03 11:43:35 +02:00
mimetypes.py gh-97646: Change .js and .mjs files mimetype to conform to RFC 9239 (#97934) 2022-10-07 12:00:53 -07:00
modulefinder.py bpo-45017: move opcode-related logic from modulefinder to dis (GH-28246) 2021-09-09 14:04:12 +01:00
netrc.py netrc: Remove unused "import shlex" (#93311) 2022-06-03 20:14:58 -07:00
nntplib.py gh-91217: deprecate nntplib (GH-91543) 2022-04-15 12:32:56 -07:00
ntpath.py gh-89545: Updates platform module to use new internal _wmi module on Windows to directly query OS properties (GH-96289) 2022-09-07 21:09:20 +01:00
nturl2path.py bpo-43607: Fix urllib handling of Windows paths with \\?\ prefix (GH-25539) 2021-04-23 18:02:47 +01:00
numbers.py gh-68163: Correct conversion of Rational instances to float (GH-25619) 2022-09-04 13:15:59 +01:00
opcode.py GH-98686: Get rid of BINARY_OP_GENERIC and COMPARE_OP_GENERIC (GH-99399) 2022-11-17 11:36:57 -08:00
operator.py bpo-44019: Add operator.call() to __all__ for the operator module (GH-29110) 2021-10-21 19:05:36 +09:00
optparse.py
os.py gh-57179: Add note on symlinks for os.walk (#94799) 2022-10-07 15:51:50 -07:00
pathlib.py gh-98832: Change wording in docstring of pathlib.Path.iterdir (GH-98833) 2022-11-09 14:05:07 -08:00
pdb.py gh-93696: Locate frozen module source with __file__ (#93697) 2022-10-25 06:22:53 -07:00
pickle.py gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609) 2022-06-09 10:12:43 +03:00
pickletools.py
pipes.py gh-91217: deprecate-pipes (GH-91779) 2022-04-21 19:28:34 -07:00
pkgutil.py [codemod] Fix non-matching bracket pairs (GH-28473) 2021-09-22 01:09:00 +02:00
platform.py gh-89545: Updates platform module to use new internal _wmi module on Windows to directly query OS properties (GH-96289) 2022-09-07 21:09:20 +01:00
plistlib.py Fix typo in error message in plistlib (GH-97540) 2022-09-28 20:46:09 +03:00
poplib.py gh-94172: Remove keyfile, certfile and check_hostname parameters (#94173) 2022-11-03 18:32:25 +01:00
posixpath.py gh-96192: fix os.ismount() to use a path that is str or bytes (#96194) 2022-11-13 20:12:32 -08:00
pprint.py gh-92546: Move pprint benchmark into pyperformance (GH-94613) 2022-07-25 11:30:13 -07:00
profile.py gh-65961: Do not rely solely on __cached__ (GH-97990) 2022-10-06 15:40:22 -07:00
pstats.py Fix type annotation of pstats.FunctionProfile.ncalls (#96741) 2022-09-14 18:33:43 -07:00
pty.py bpo-44712: Replace "type(literal)" with corresponding builtin types (GH-27294) 2022-05-08 17:10:11 +03:00
py_compile.py bpo-45428: Fix reading filenames from stdin in py_compile (GH-28848) 2021-10-15 12:38:55 +03:00
pyclbr.py bpo-40443: Remove unused imports (GH-25429) 2021-04-16 11:26:06 +02:00
pydoc.py gh-98374: Suppress ImportError for invalid query for help() command. (gh-98450) 2022-10-20 10:56:21 +09:00
queue.py gh-90879: Fix missing parameter for put_nowait() (GH-91514) 2022-04-14 17:23:57 +09:00
quopri.py
random.py bpo-37000: Remove obsolete comment in _randbelow_with_getrandbits (#95775) 2022-08-08 18:22:26 -05:00
reprlib.py gh-92734: Add indentation feature to reprlib.Repr (GH-92735) 2022-09-08 13:51:44 -05:00
rlcompleter.py gh-92345: Import rlcompleter before sys.path is extended (#92346) 2022-05-05 21:24:16 +02:00
runpy.py bpo-26792: Improve docstrings of runpy module run_functions (#30729) 2022-04-29 12:22:46 -06:00
sched.py
secrets.py gh-99305: Speed up secrets.token_hex() ~2x (#99306) 2022-11-11 14:45:24 -08:00
selectors.py bpo-46583: remove unused sys.version_info check from selectors (GH-31023) 2022-02-02 10:15:02 +02:00
shelve.py
shlex.py gh-94352: shlex.split() no longer accepts None (#94353) 2022-07-04 15:29:19 +02:00
shutil.py bpo-38523: ignore_dangling_symlinks does not apply recursively (GH-22937) 2022-11-07 11:45:16 +00:00
signal.py bpo-27718: Fix help for the signal module (GH-30063) 2021-12-13 11:21:55 +02:00
site.py gh-90473: disable user site packages on WASI/Emscripten (GH-93633) 2022-06-09 17:45:29 +02:00
smtplib.py gh-94172: Remove keyfile, certfile and check_hostname parameters (#94173) 2022-11-03 18:32:25 +01:00
sndhdr.py gh-85525: Indicate supported sound header formats (#21575) 2022-10-15 09:30:05 -04:00
socket.py gh-96320: WASI socket fixes (#96388) 2022-08-30 06:36:11 +02:00
socketserver.py bpo-40280: Disable AF_UNIX, AF_PACKET, SO_REUSE* on Emscripten (#31829) 2022-03-11 23:25:14 +01:00
sre_compile.py bpo-47152: Convert the re module into a package (GH-32177) 2022-04-02 11:35:13 +03:00
sre_constants.py bpo-47152: Convert the re module into a package (GH-32177) 2022-04-02 11:35:13 +03:00
sre_parse.py bpo-47152: Convert the re module into a package (GH-32177) 2022-04-02 11:35:13 +03:00
ssl.py gh-94199: Remove the ssl.wrap_socket() function (#94203) 2022-07-08 15:20:15 +02:00
stat.py
statistics.py GH-99155: Fix NormalDist pickle with 0 and 1 protocols (GH99156) 2022-11-06 20:56:41 -06:00
string.py bpo-46307: Add string.Template.get_identifiers() method (GH-30493) 2022-01-11 11:15:42 -08:00
stringprep.py
struct.py
subprocess.py Add note on capture_output arg to subprocess.run() docstring (#98012) 2022-10-07 10:08:08 -07:00
sunau.py bpo-44712: Replace "type(literal)" with corresponding builtin types (GH-27294) 2022-05-08 17:10:11 +03:00
symtable.py Change list to view object (#93661) 2022-06-11 11:54:31 +01:00
sysconfig.py gh-99201: fix IndexError when initializing sysconfig config variables 2022-11-19 20:47:09 +00:00
tabnanny.py gh-97639: Remove tokenize.NL check from tabnanny (#97640) 2022-10-03 17:41:29 -07:00
tarfile.py gh-99325: Remove unused NameError handling (#99326) 2022-11-11 09:56:57 +00:00
telnetlib.py gh-91217: deprecate telnetlib (GH-91958) 2022-04-26 10:45:08 -07:00
tempfile.py gh-58451: Add optional delete_on_close parameter to NamedTemporaryFile (GH-97015) 2022-10-04 23:37:33 +01:00
textwrap.py bpo-46544: Do not leak x and uspace in textwrap.TextWrapper (GH-30955) 2022-01-27 13:55:58 +02:00
this.py
threading.py gh-98610: Adjust the Optional Restrictions on Subinterpreters (GH-98618) 2022-10-31 12:35:54 -07:00
timeit.py gh-90085: Remove vestigial -t and -c timeit options (#94941) 2022-10-07 15:38:20 -07:00
token.py gh-97669: Create Tools/build/ directory (#97963) 2022-10-17 12:01:00 +02:00
tokenize.py bpo-46565: del loop vars that are leaking into module namespaces (GH-30993) 2022-02-03 11:20:08 +02:00
trace.py
traceback.py gh-99103: Normalize specialized traceback anchors against the current line (GH-99145) 2022-11-12 15:37:25 -08:00
tracemalloc.py
tty.py
turtle.py gh-91212: Fixed flickering when the tracer is turned off (#95129) 2022-09-28 23:40:51 -07:00
types.py gh-96415: Remove types._cell_factory from a module namespace (#96416) 2022-10-07 10:27:14 -07:00
typing.py gh-98852: Fix subscription of type aliases (GH-98920) 2022-11-01 09:33:09 +02:00
uu.py gh-91217: deprecate uu (GH-92009) 2022-04-27 20:26:33 -07:00
uuid.py gh-98415: Fix uuid.getnode() ifconfig implementation (#98423) 2022-11-02 19:41:20 +01:00
warnings.py gh-91230: Concise catch_warnings with simplefilter (#91435) 2022-04-23 17:55:22 -07:00
wave.py gh-77171: Fixes SubFormat check to compare the entire value. Add docs (GH-97509) 2022-09-23 16:08:21 +01:00
weakref.py Remove unnecessary registration of weakref.WeakSet to _collections_abc.Set (GH-32211) 2022-03-31 09:11:35 -05:00
webbrowser.py bpo-43137: Revert "webbrowser: Don't run gvfs-open on GNOME" (GH-30417) 2022-01-05 11:53:23 +00:00
xdrlib.py gh-91217: deprecate xdrlib (GH-92066) 2022-04-29 18:22:10 -07:00
zipapp.py bpo-46951: Order contents of zipapps (GH-31713) 2022-05-27 19:04:29 +03:00
zipfile.py gh-98286: handle empty filename in ZipFile/ZipInfo properly (#98346) 2022-10-28 22:45:46 -07:00
zipimport.py gh-91181: drop support for bytes on sys.path (GH-31934) 2022-07-16 18:07:53 -07:00