@@ -90,7 +90,7 @@ Improved Modules
9090array
9191-----
9292
93- * Add ``'w' `` type code that can be used for Unicode strings.
93+ * Add ``'w' `` type code (`` Py_UCS4 ``) that can be used for Unicode strings.
9494 It can be used instead of ``'u' `` type code, which is deprecated.
9595 (Contributed by Inada Naoki in :gh: `80480 `.)
9696
@@ -146,11 +146,11 @@ Deprecated
146146 methods of the :class: `wave.Wave_read ` and :class: `wave.Wave_write ` classes.
147147 They will be removed in Python 3.15.
148148 (Contributed by Victor Stinner in :gh: `105096 `.)
149- * Creating a :class: `typing.NamedTuple ` class using keyword arguments to denote
149+ * :mod: ` typing `: Creating a :class: `typing.NamedTuple ` class using keyword arguments to denote
150150 the fields (``NT = NamedTuple("NT", x=int, y=int) ``) is deprecated, and will
151151 be disallowed in Python 3.15. Use the class-based syntax or the functional
152152 syntax instead. (Contributed by Alex Waygood in :gh: `105566 `.)
153- * When using the functional syntax to create a :class: `typing.NamedTuple `
153+ * :mod: ` typing `: When using the functional syntax to create a :class: `typing.NamedTuple `
154154 class or a :class: `typing.TypedDict ` class, failing to pass a value to the
155155 'fields' parameter (``NT = NamedTuple("NT") `` or ``TD = TypedDict("TD") ``) is
156156 deprecated. Passing ``None `` to the 'fields' parameter
@@ -172,6 +172,297 @@ Deprecated
172172 Replace ``ctypes.SetPointerType(item_type, size) `` with ``item_type * size ``.
173173 (Contributed by Victor Stinner in :gh: `105733 `.)
174174
175+ Pending Removal in Python 3.14
176+ ------------------------------
177+
178+ * :mod: `argparse `: The *type *, *choices *, and *metavar * parameters
179+ of :class: `!argparse.BooleanOptionalAction ` are deprecated
180+ and will be removed in 3.14.
181+ (Contributed by Nikita Sobolev in :gh: `92248 `.)
182+
183+ * :mod: `ast `: The following features have been deprecated in documentation
184+ since Python 3.8, now cause a :exc: `DeprecationWarning ` to be emitted at
185+ runtime when they are accessed or used, and will be removed in Python 3.14:
186+
187+ * :class: `!ast.Num `
188+ * :class: `!ast.Str `
189+ * :class: `!ast.Bytes `
190+ * :class: `!ast.NameConstant `
191+ * :class: `!ast.Ellipsis `
192+
193+ Use :class: `ast.Constant ` instead.
194+ (Contributed by Serhiy Storchaka in :gh: `90953 `.)
195+
196+ * :mod: `collections.abc `: Deprecated :class: `~collections.abc.ByteString `.
197+ Prefer :class: `!Sequence ` or :class: `~collections.abc.Buffer `.
198+ For use in typing, prefer a union, like ``bytes | bytearray ``,
199+ or :class: `collections.abc.Buffer `.
200+ (Contributed by Shantanu Jain in :gh: `91896 `.)
201+
202+ * :mod: `email `: Deprecated the *isdst * parameter in :func: `email.utils.localtime `.
203+ (Contributed by Alan Williams in :gh: `72346 `.)
204+
205+ * :mod: `importlib `: ``__package__ `` and ``__cached__ `` will cease to be set or
206+ taken into consideration by the import system (:gh: `97879 `).
207+
208+ * :mod: `importlib.abc ` deprecated classes:
209+
210+ * :class: `!importlib.abc.ResourceReader `
211+ * :class: `!importlib.abc.Traversable `
212+ * :class: `!importlib.abc.TraversableResources `
213+
214+ Use :mod: `importlib.resources.abc ` classes instead:
215+
216+ * :class: `importlib.resources.abc.Traversable `
217+ * :class: `importlib.resources.abc.TraversableResources `
218+
219+ (Contributed by Jason R. Coombs and Hugo van Kemenade in :gh: `93963 `.)
220+
221+ * :mod: `itertools ` had undocumented, inefficient, historically buggy,
222+ and inconsistent support for copy, deepcopy, and pickle operations.
223+ This will be removed in 3.14 for a significant reduction in code
224+ volume and maintenance burden.
225+ (Contributed by Raymond Hettinger in :gh: `101588 `.)
226+
227+ * :mod: `multiprocessing `: The default start method will change to a safer one on
228+ Linux, BSDs, and other non-macOS POSIX platforms where ``'fork' `` is currently
229+ the default (:gh: `84559 `). Adding a runtime warning about this was deemed too
230+ disruptive as the majority of code is not expected to care. Use the
231+ :func: `~multiprocessing.get_context ` or
232+ :func: `~multiprocessing.set_start_method ` APIs to explicitly specify when
233+ your code *requires * ``'fork' ``. See :ref: `multiprocessing-start-methods `.
234+
235+ * :mod: `pathlib `: :meth: `~pathlib.PurePath.is_relative_to `,
236+ :meth: `~pathlib.PurePath.relative_to `: passing additional arguments is
237+ deprecated.
238+
239+ * :func: `pkgutil.find_loader ` and :func: `pkgutil.get_loader `
240+ now raise :exc: `DeprecationWarning `;
241+ use :func: `importlib.util.find_spec ` instead.
242+ (Contributed by Nikita Sobolev in :gh: `97850 `.)
243+
244+ * :mod: `pty `:
245+
246+ * ``master_open() ``: use :func: `pty.openpty `.
247+ * ``slave_open() ``: use :func: `pty.openpty `.
248+
249+ * :func: `shutil.rmtree ` *onerror * parameter is deprecated in 3.12,
250+ and will be removed in 3.14: use the *onexc * parameter instead.
251+
252+ * :mod: `sqlite3 `:
253+
254+ * :data: `~sqlite3.version ` and :data: `~sqlite3.version_info `.
255+
256+ * :meth: `~sqlite3.Cursor.execute ` and :meth: `~sqlite3.Cursor.executemany `
257+ if :ref: `named placeholders <sqlite3-placeholders >` are used and
258+ *parameters * is a sequence instead of a :class: `dict `.
259+
260+ * date and datetime adapter, date and timestamp converter:
261+ see the :mod: `sqlite3 ` documentation for suggested replacement recipes.
262+
263+ * :class: `types.CodeType `: Accessing ``co_lnotab `` was deprecated in :pep: `626 `
264+ since 3.10 and was planned to be removed in 3.12,
265+ but it only got a proper :exc: `DeprecationWarning ` in 3.12.
266+ May be removed in 3.14.
267+ (Contributed by Nikita Sobolev in :gh: `101866 `.)
268+
269+ * :mod: `typing `: :class: `~typing.ByteString `, deprecated since Python 3.9,
270+ now causes a :exc: `DeprecationWarning ` to be emitted when it is used.
271+
272+ * :class: `!urllib.parse.Quoter `.
273+
274+ * :mod: `xml.etree.ElementTree `: Testing the truth value of an
275+ :class: `~xml.etree.ElementTree.Element ` is deprecated and will raise an
276+ exception in Python 3.14.
277+
278+ Pending Removal in Python 3.15
279+ ------------------------------
280+
281+ * :class: `typing.NamedTuple `:
282+
283+ * The undocumented keyword argument syntax for creating NamedTuple classes
284+ (``NT = NamedTuple("NT", x=int) ``) is deprecated, and will be disallowed in
285+ 3.15. Use the class-based syntax or the functional syntax instead.
286+
287+ * When using the functional syntax to create a NamedTuple class, failing to
288+ pass a value to the 'fields' parameter (``NT = NamedTuple("NT") ``) is
289+ deprecated. Passing ``None `` to the 'fields' parameter
290+ (``NT = NamedTuple("NT", None) ``) is also deprecated. Both will be
291+ disallowed in Python 3.15. To create a NamedTuple class with 0 fields, use
292+ ``class NT(NamedTuple): pass `` or ``NT = NamedTuple("NT", []) ``.
293+
294+ * :class: `typing.TypedDict `: When using the functional syntax to create a
295+ TypedDict class, failing to pass a value to the 'fields' parameter (``TD =
296+ TypedDict("TD") ``) is deprecated. Passing ``None `` to the 'fields' parameter
297+ (``TD = TypedDict("TD", None) ``) is also deprecated. Both will be disallowed
298+ in Python 3.15. To create a TypedDict class with 0 fields, use ``class
299+ TD(TypedDict): pass `` or ``TD = TypedDict("TD", {}) ``.
300+
301+ * :mod: `wave `: Deprecate the ``getmark() ``, ``setmark() `` and ``getmarkers() ``
302+ methods of the :class: `wave.Wave_read ` and :class: `wave.Wave_write ` classes.
303+ They will be removed in Python 3.15.
304+ (Contributed by Victor Stinner in :gh: `105096 `.)
305+
306+ Pending Removal in Python 3.16
307+ ------------------------------
308+
309+ * :class: `array.array ` ``'u' `` type (``wchar_t ``):
310+ use the ``'w' `` type instead (``Py_UCS4 ``).
311+
312+ Pending Removal in Future Versions
313+ ----------------------------------
314+
315+ The following APIs were deprecated in earlier Python versions and will be removed,
316+ although there is currently no date scheduled for their removal.
317+
318+ * :mod: `argparse `: Nesting argument groups and nesting mutually exclusive
319+ groups are deprecated.
320+
321+ * :mod: `builtins `:
322+
323+ * ``~bool ``, bitwise inversion on bool.
324+ * ``bool(NotImplemented) ``.
325+ * Generators: ``throw(type, exc, tb) `` and ``athrow(type, exc, tb) ``
326+ signature is deprecated: use ``throw(exc) `` and ``athrow(exc) `` instead,
327+ the single argument signature.
328+ * Currently Python accepts numeric literals immediately followed by keywords,
329+ for example ``0in x ``, ``1or x ``, ``0if 1else 2 ``. It allows confusing and
330+ ambiguous expressions like ``[0x1for x in y] `` (which can be interpreted as
331+ ``[0x1 for x in y] `` or ``[0x1f or x in y] ``). A syntax warning is raised
332+ if the numeric literal is immediately followed by one of keywords
333+ :keyword: `and `, :keyword: `else `, :keyword: `for `, :keyword: `if `,
334+ :keyword: `in `, :keyword: `is ` and :keyword: `or `. In a future release it
335+ will be changed to a syntax error. (:gh: `87999 `)
336+ * Support for ``__index__() `` and ``__int__() `` method returning non-int type:
337+ these methods will be required to return an instance of a strict subclass of
338+ :class: `int `.
339+ * Support for ``__float__() `` method returning a strict subclass of
340+ :class: `float `: these methods will be required to return an instance of
341+ :class: `float `.
342+ * Support for ``__complex__() `` method returning a strict subclass of
343+ :class: `complex `: these methods will be required to return an instance of
344+ :class: `complex `.
345+ * Delegation of ``int() `` to ``__trunc__() `` method.
346+
347+ * :mod: `calendar `: ``calendar.January `` and ``calendar.February `` constants are
348+ deprecated and replaced by :data: `calendar.Month.JANUARY ` and
349+ :data: `calendar.Month.FEBRUARY `.
350+ (Contributed by Prince Roshan in :gh: `103636 `.)
351+
352+ * :mod: `datetime `:
353+
354+ * :meth: `~datetime.datetime.utcnow `:
355+ use ``datetime.datetime.now(tz=datetime.UTC) ``.
356+ * :meth: `~datetime.datetime.utcfromtimestamp `:
357+ use ``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC) ``.
358+
359+ * :mod: `gettext `: Plural value must be an integer.
360+
361+ * :mod: `importlib `:
362+
363+ * ``load_module() `` method: use ``exec_module() `` instead.
364+ * :func: `~importlib.util.cache_from_source ` *debug_override * parameter is
365+ deprecated: use the *optimization * parameter instead.
366+
367+ * :mod: `importlib.metadata `:
368+
369+ * ``EntryPoints `` tuple interface.
370+ * Implicit ``None `` on return values.
371+
372+ * :mod: `importlib.resources `: First parameter to files is renamed to 'anchor'.
373+ * :mod: `importlib.resources ` deprecated methods:
374+
375+ * ``contents() ``
376+ * ``is_resource() ``
377+ * ``open_binary() ``
378+ * ``open_text() ``
379+ * ``path() ``
380+ * ``read_binary() ``
381+ * ``read_text() ``
382+
383+ Use ``files() `` instead. Refer to `importlib-resources: Migrating from Legacy
384+ <https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy> `_
385+ for migration advice.
386+
387+ * :func: `locale.getdefaultlocale `: use :func: `locale.setlocale() `,
388+ :func: `locale.getencoding() ` and :func: `locale.getlocale() ` instead
389+ (:gh: `90817 `)
390+
391+ * :mod: `mailbox `: Use of StringIO input and text mode is deprecated, use
392+ BytesIO and binary mode instead.
393+
394+ * :mod: `os `: Calling :func: `os.register_at_fork ` in multi-threaded process.
395+
396+ * :class: `!pydoc.ErrorDuringImport `: A tuple value for *exc_info * parameter is
397+ deprecated, use an exception instance.
398+
399+ * :mod: `re `: bad character in group name.
400+
401+ * :mod: `ssl ` options and protocols:
402+
403+ * :class: `ssl.SSLContext ` without protocol argument is deprecated.
404+ * :class: `ssl.SSLContext `: :meth: `~ssl.SSLContext.set_npn_protocols ` and
405+ :meth: `!~ssl.SSLContext.selected_npn_protocol ` are deprecated: use ALPN
406+ instead.
407+ * ``ssl.OP_NO_SSL* `` options
408+ * ``ssl.OP_NO_TLS* `` options
409+ * ``ssl.PROTOCOL_SSLv3 ``
410+ * ``ssl.PROTOCOL_TLS ``
411+ * ``ssl.PROTOCOL_TLSv1 ``
412+ * ``ssl.PROTOCOL_TLSv1_1 ``
413+ * ``ssl.PROTOCOL_TLSv1_2 ``
414+ * ``ssl.TLSVersion.SSLv3 ``
415+ * ``ssl.TLSVersion.TLSv1 ``
416+ * ``ssl.TLSVersion.TLSv1_1 ``
417+
418+ * :mod: `!sre_compile `, :mod: `!sre_constants ` and :mod: `!sre_parse ` modules.
419+
420+ * ``types.CodeType.co_lnotab ``: use the ``co_lines `` attribute instead.
421+
422+ * :class: `typing.Text ` (:gh: `92332 `).
423+
424+ * :func: `sysconfig.is_python_build ` *check_home * parameter is deprecated and
425+ ignored.
426+
427+ * :mod: `threading ` methods:
428+
429+ * :meth: `!threading.Condition.notifyAll `: use :meth: `~threading.Condition.notify_all `.
430+ * :meth: `!threading.Event.isSet `: use :meth: `~threading.Event.is_set `.
431+ * :meth: `!threading.Thread.isDaemon `, :meth: `threading.Thread.setDaemon `:
432+ use :attr: `threading.Thread.daemon ` attribute.
433+ * :meth: `!threading.Thread.getName `, :meth: `threading.Thread.setName `:
434+ use :attr: `threading.Thread.name ` attribute.
435+ * :meth: `!threading.currentThread `: use :meth: `threading.current_thread `.
436+ * :meth: `!threading.activeCount `: use :meth: `threading.active_count `.
437+
438+ * :class: `unittest.IsolatedAsyncioTestCase `: it is deprecated to return a value
439+ that is not None from a test case.
440+
441+ * :mod: `urllib.request `: :class: `~urllib.request.URLopener ` and
442+ :class: `~urllib.request.FancyURLopener ` style of invoking requests is
443+ deprecated. Use newer :func: `~urllib.request.urlopen ` functions and methods.
444+
445+ * :func: `!urllib.parse.to_bytes `.
446+
447+ * :mod: `urllib.parse ` deprecated functions: :func: `~urllib.parse.urlparse ` instead
448+
449+ * :func: `~!urllib.parse.splittype `
450+ * :func: `~!urllib.parse.splithost `
451+ * :func: `~!urllib.parse.splituser `
452+ * :func: `~!urllib.parse.splitpasswd `
453+ * :func: `~!urllib.parse.splitport `
454+ * :func: `~!urllib.parse.splitnport `
455+ * :func: `~!urllib.parse.splitquery `
456+ * :func: `~!urllib.parse.splittag `
457+ * :func: `~!urllib.parse.splitattr `
458+ * :func: `~!urllib.parse.splitvalue `
459+
460+ * :mod: `wsgiref `: ``SimpleHandler.stdout.write() `` should not do partial
461+ writes.
462+
463+ * :meth: `zipimport.zipimporter.load_module ` is deprecated:
464+ use :meth: `~zipimport.zipimporter.exec_module ` instead.
465+
175466
176467Removed
177468=======
@@ -617,6 +908,8 @@ Removed
617908Pending Removal in Python 3.14
618909------------------------------
619910
911+ * Creating immutable types (:data: `Py_TPFLAGS_IMMUTABLETYPE `) with mutable
912+ bases using the C API.
620913* Global configuration variables:
621914
622915 * :c:var: `Py_DebugFlag `: use :c:member: `PyConfig.parser_debug `
0 commit comments