@@ -2668,25 +2668,34 @@ urllib
26682668Deprecated
26692669==========
26702670
2671+ New Deprecations
2672+ ----------------
2673+
2674+ * Passing a complex number as the *real * or *imag * argument in the
2675+ :func: `complex ` constructor is now deprecated;
2676+ complex numbers should only be passed as a single positional argument.
2677+ (Contributed by Serhiy Storchaka in :gh: `109218 `.)
2678+
26712679* :mod: `argparse `:
26722680
2673- * Passing the undocumented keyword argument *prefix_chars * to
2674- :meth: `~argparse.ArgumentParser.add_argument_group ` is now
2675- deprecated.
2681+ * Passing the undocumented keyword argument *prefix_chars * to the
2682+ :meth: `~argparse.ArgumentParser.add_argument_group ` method is now deprecated.
26762683 (Contributed by Savannah Ostrowski in :gh: `125563 `.)
2684+
26772685 * Deprecated the :class: `argparse.FileType ` type converter.
2678- Anything with resource management should be done downstream after the
2679- arguments are parsed.
2686+ Anything relating to resource management should be handled
2687+ downstream, after the arguments have been parsed.
26802688 (Contributed by Serhiy Storchaka in :gh: `58032 `.)
26812689
26822690* :mod: `asyncio `:
26832691
2684- * :func: `!asyncio.iscoroutinefunction ` is deprecated
2692+ * The :func: `!asyncio.iscoroutinefunction ` is now deprecated
26852693 and will be removed in Python 3.16;
26862694 use :func: `inspect.iscoroutinefunction ` instead.
26872695 (Contributed by Jiahao Li and Kumar Aditya in :gh: `122875 `.)
26882696
2689- * :mod: `asyncio ` policy system is deprecated and will be removed in Python 3.16.
2697+ * The :mod: `asyncio ` policy system is deprecated
2698+ and will be removed in Python 3.16.
26902699 In particular, the following classes and functions are deprecated:
26912700
26922701 * :class: `asyncio.AbstractEventLoopPolicy `
@@ -2697,99 +2706,102 @@ Deprecated
26972706 * :func: `asyncio.set_event_loop_policy `
26982707
26992708 Users should use :func: `asyncio.run ` or :class: `asyncio.Runner ` with
2700- *loop_factory * to use the desired event loop implementation.
2709+ the *loop_factory * argument to use the desired event loop implementation.
27012710
2702- For example, to use :class: `asyncio.SelectorEventLoop ` on Windows::
2711+ For example, to use :class: `asyncio.SelectorEventLoop ` on Windows:
27032712
2704- import asyncio
2713+ .. code-block :: python
27052714
2706- async def main():
2707- ...
2715+ import asyncio
27082716
2709- asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)
2717+ async def main ():
2718+ ...
27102719
2711- (Contributed by Kumar Aditya in :gh: ` 127949 `. )
2720+ asyncio.run(main(), loop_factory = asyncio.SelectorEventLoop )
27122721
2713- * :mod: `builtins `:
2714- Passing a complex number as the *real * or *imag * argument in the
2715- :func: `complex ` constructor is now deprecated; it should only be passed
2716- as a single positional argument.
2717- (Contributed by Serhiy Storchaka in :gh: `109218 `.)
2722+ (Contributed by Kumar Aditya in :gh: `127949 `.)
27182723
27192724* :mod: `codecs `:
2720- :func: `codecs.open ` is now deprecated. Use :func: `open ` instead.
2725+ The :func: `codecs.open ` function is now deprecated,
2726+ and will be removed in a future version of Python.
2727+ Use :func: `open ` instead.
27212728 (Contributed by Inada Naoki in :gh: `133036 `.)
27222729
27232730* :mod: `ctypes `:
27242731
27252732 * On non-Windows platforms, setting :attr: `.Structure._pack_ ` to use a
2726- MSVC-compatible default memory layout is deprecated in favor of setting
2727- :attr: `.Structure._layout_ ` to ``'ms' ``.
2733+ MSVC-compatible default memory layout is now deprecated in favor of setting
2734+ :attr: `.Structure._layout_ ` to ``'ms' ``, and will be removed in Python 3.19 .
27282735 (Contributed by Petr Viktorin in :gh: `131747 `.)
27292736
2730- * Calling :func: `ctypes.POINTER ` on a string is deprecated.
2731- Use :ref: `ctypes-incomplete-types ` for self-referential structures.
2737+ * Calling :func: `ctypes.POINTER ` on a string is now deprecated.
2738+ Use :ref: `incomplete types <ctypes-incomplete-types >`
2739+ for self-referential structures.
27322740 Also, the internal ``ctypes._pointer_type_cache `` is deprecated.
27332741 See :func: `ctypes.POINTER ` for updated implementation details.
27342742 (Contributed by Sergey Myrianov in :gh: `100926 `.)
27352743
27362744* :mod: `functools `:
27372745 Calling the Python implementation of :func: `functools.reduce ` with *function *
2738- or *sequence * as keyword arguments is now deprecated.
2746+ or *sequence * as keyword arguments is now deprecated;
2747+ the parameters will be made positional-only in Python 3.16.
27392748 (Contributed by Kirill Podoprigora in :gh: `121676 `.)
27402749
27412750* :mod: `logging `:
2742- Support for custom logging handlers with the *strm * argument is deprecated
2743- and scheduled for removal in Python 3.16. Define handlers with the *stream *
2744- argument instead. (Contributed by Mariusz Felisiak in :gh: `115032 `.)
2751+ Support for custom logging handlers with the *strm * argument
2752+ is now deprecated and scheduled for removal in Python 3.16.
2753+ Define handlers with the *stream * argument instead.
2754+ (Contributed by Mariusz Felisiak in :gh: `115032 `.)
27452755
27462756* :mod: `mimetypes `:
2747- Valid extensions start with a '.' or are empty for
2757+ Valid extensions are either empty or must start with '.' for
27482758 :meth: `mimetypes.MimeTypes.add_type `.
27492759 Undotted extensions are deprecated and will
27502760 raise a :exc: `ValueError ` in Python 3.16.
27512761 (Contributed by Hugo van Kemenade in :gh: `75223 `.)
27522762
2753- * :mod: `!nturl2path `: This module is now deprecated. Call
2754- :func: ` urllib.request.url2pathname ` and :func: `~ urllib.request.pathname2url `
2755- instead.
2763+ * :mod: `!nturl2path `:
2764+ This module is now deprecated. Call :func: `urllib.request.url2pathname `
2765+ and :func: ` ~urllib.request.pathname2url ` instead.
27562766 (Contributed by Barney Gale in :gh: `125866 `.)
27572767
27582768* :mod: `os `:
2759- :term: `Soft deprecate <soft deprecated> ` :func: `os.popen ` and
2760- :func: `os.spawn* <os.spawnl> ` functions. They should no longer be used to
2761- write new code. The :mod: `subprocess ` module is recommended instead.
2769+ The :func: `os.popen ` and :func: `os.spawn* <os.spawnl> ` functions
2770+ are now :term: `soft deprecated `.
2771+ They should no longer be used to write new code.
2772+ The :mod: `subprocess ` module is recommended instead.
27622773 (Contributed by Victor Stinner in :gh: `120743 `.)
27632774
27642775* :mod: `pathlib `:
2765- :meth: `!pathlib.PurePath.as_uri ` is deprecated and will be removed in Python
2766- 3.19. Use :meth: `pathlib.Path.as_uri ` instead.
2776+ :meth: `!pathlib.PurePath.as_uri ` is now deprecated
2777+ and scheduled for removal in Python 3.19.
2778+ Use :meth: `pathlib.Path.as_uri ` instead.
27672779 (Contributed by Barney Gale in :gh: `123599 `.)
27682780
27692781* :mod: `pdb `:
27702782 The undocumented ``pdb.Pdb.curframe_locals `` attribute is now a deprecated
2771- read-only property. The low overhead dynamic frame locals access added in
2772- Python 3.13 by PEP 667 means the frame locals cache reference previously
2773- stored in this attribute is no longer needed. Derived debuggers should access
2783+ read-only property, which will be removed in a future version of Python.
2784+ The low overhead dynamic frame locals access added in Python 3.13 by :pep: `667 `
2785+ means the frame locals cache reference previously stored in this attribute
2786+ is no longer needed. Derived debuggers should access
27742787 ``pdb.Pdb.curframe.f_locals `` directly in Python 3.13 and later versions.
27752788 (Contributed by Tian Gao in :gh: `124369 ` and :gh: `125951 `.)
27762789
27772790* :mod: `symtable `:
2778- Deprecate :meth: `symtable.Class.get_methods ` due to the lack of interest.
2791+ Deprecate :meth: `symtable.Class.get_methods ` due to the lack of interest,
2792+ scheduled for removal in Python 3.16.
27792793 (Contributed by Bénédikt Tran in :gh: `119698 `.)
27802794
27812795* :mod: `tkinter `:
27822796 The :class: `!tkinter.Variable ` methods :meth: `!trace_variable `,
27832797 :meth: `!trace_vdelete ` and :meth: `!trace_vinfo ` are now deprecated.
2784- Use :meth: `!trace_add `, :meth: `!trace_remove ` and :meth: `!trace_info `
2785- instead.
2798+ Use :meth: `!trace_add `, :meth: `!trace_remove ` and :meth: `!trace_info ` instead.
27862799 (Contributed by Serhiy Storchaka in :gh: `120220 `.)
27872800
27882801* :mod: `urllib.parse `:
27892802 Accepting objects with false values (like ``0 `` and ``[] ``) except empty
2790- strings, byte-like objects and ``None `` in :mod: `urllib.parse ` functions
2791- :func: `~urllib.parse.parse_qsl ` and :func: `~urllib.parse.parse_qs ` is now
2792- deprecated.
2803+ strings, bytes-like objects and ``None `` in :func: `~urllib.parse.parse_qsl `
2804+ and :func: `~urllib.parse.parse_qs ` is now deprecated.
27932805 (Contributed by Serhiy Storchaka in :gh: `116897 `.)
27942806
27952807.. Add deprecations above alphabetically, not here at the end.
0 commit comments