Debian Codegraph @

Doc/deprecations/pending-removal-in-3.15.rst

raw
1 Pending removal in Python 3.15
2 ------------------------------
3
4 * The import system:
5
6 * Setting :attr:`~module.__cached__` on a module while
7 failing to set :attr:`__spec__.cached <importlib.machinery.ModuleSpec.cached>`
8 is deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or
9 take into consideration by the import system or standard library. (:gh:`97879`)
10
11 * Setting :attr:`~module.__package__` on a module while
12 failing to set :attr:`__spec__.parent <importlib.machinery.ModuleSpec.parent>`
13 is deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or
14 take into consideration by the import system or standard library. (:gh:`97879`)
15
16 * :mod:`ctypes`:
17
18 * The undocumented :func:`!ctypes.SetPointerType` function
19 has been deprecated since Python 3.13.
20
21 * :mod:`http.server`:
22
23 * The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler`
24 has been deprecated since Python 3.13.
25 No direct replacement exists.
26 *Anything* is better than CGI to interface
27 a web server with a request handler.
28
29 * The :option:`!--cgi` flag to the :program:`python -m http.server`
30 command-line interface has been deprecated since Python 3.13.
31
32 * :mod:`importlib`:
33
34 * ``load_module()`` method: use ``exec_module()`` instead.
35
36 * :class:`locale`:
37
38 * The :func:`~locale.getdefaultlocale` function
39 has been deprecated since Python 3.11.
40 Its removal was originally planned for Python 3.13 (:gh:`90817`),
41 but has been postponed to Python 3.15.
42 Use :func:`~locale.getlocale`, :func:`~locale.setlocale`,
43 and :func:`~locale.getencoding` instead.
44 (Contributed by Hugo van Kemenade in :gh:`111187`.)
45
46 * :mod:`pathlib`:
47
48 * :meth:`.PurePath.is_reserved`
49 has been deprecated since Python 3.13.
50 Use :func:`os.path.isreserved` to detect reserved paths on Windows.
51
52 * :mod:`platform`:
53
54 * :func:`~platform.java_ver` has been deprecated since Python 3.13.
55 This function is only useful for Jython support, has a confusing API,
56 and is largely untested.
57
58 * :mod:`sysconfig`:
59
60 * The *check_home* argument of :func:`sysconfig.is_python_build` has been
61 deprecated since Python 3.12.
62
63 * :mod:`threading`:
64
65 * :func:`~threading.RLock` will take no arguments in Python 3.15.
66 Passing any arguments has been deprecated since Python 3.14,
67 as the Python version does not permit any arguments,
68 but the C version allows any number of positional or keyword arguments,
69 ignoring every argument.
70
71 * :mod:`types`:
72
73 * :class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was
74 deprecated in :pep:`626`
75 since 3.10 and was planned to be removed in 3.12,
76 but it only got a proper :exc:`DeprecationWarning` in 3.12.
77 May be removed in 3.15.
78 (Contributed by Nikita Sobolev in :gh:`101866`.)
79
80 * :mod:`typing`:
81
82 * The undocumented keyword argument syntax for creating
83 :class:`~typing.NamedTuple` classes
84 (for example, ``Point = NamedTuple("Point", x=int, y=int)``)
85 has been deprecated since Python 3.13.
86 Use the class-based syntax or the functional syntax instead.
87
88 * When using the functional syntax of :class:`~typing.TypedDict`\s, failing
89 to pass a value to the *fields* parameter (``TD = TypedDict("TD")``) or
90 passing ``None`` (``TD = TypedDict("TD", None)``) has been deprecated
91 since Python 3.13.
92 Use ``class TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})``
93 to create a TypedDict with zero field.
94
95 * The :func:`typing.no_type_check_decorator` decorator function
96 has been deprecated since Python 3.13.
97 After eight years in the :mod:`typing` module,
98 it has yet to be supported by any major type checker.
99
100 * :mod:`wave`:
101
102 * The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`,
103 and :meth:`~wave.Wave_read.getmarkers` methods of
104 the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes
105 have been deprecated since Python 3.13.
106
107 * :mod:`zipimport`:
108
109 * :meth:`~zipimport.zipimporter.load_module` has been deprecated since
110 Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead.
111 (Contributed by Jiahao Li in :gh:`125746`.)