@@ -2660,25 +2660,34 @@ urllib
26602660Deprecated
26612661==========
26622662
2663+ New deprecations
2664+ ----------------
2665+
2666+ * Passing a complex number as the *real * or *imag * argument in the
2667+ :func: `complex ` constructor is now deprecated;
2668+ complex numbers should only be passed as a single positional argument.
2669+ (Contributed by Serhiy Storchaka in :gh: `109218 `.)
2670+
26632671* :mod: `argparse `:
26642672
2665- * Passing the undocumented keyword argument *prefix_chars * to
2666- :meth: `~argparse.ArgumentParser.add_argument_group ` is now
2667- deprecated.
2673+ * Passing the undocumented keyword argument *prefix_chars * to the
2674+ :meth: `~argparse.ArgumentParser.add_argument_group ` method is now deprecated.
26682675 (Contributed by Savannah Ostrowski in :gh: `125563 `.)
2676+
26692677 * Deprecated the :class: `argparse.FileType ` type converter.
2670- Anything with resource management should be done downstream after the
2671- arguments are parsed.
2678+ Anything relating to resource management should be handled
2679+ downstream, after the arguments have been parsed.
26722680 (Contributed by Serhiy Storchaka in :gh: `58032 `.)
26732681
26742682* :mod: `asyncio `:
26752683
2676- * :func: `!asyncio.iscoroutinefunction ` is deprecated
2684+ * The :func: `!asyncio.iscoroutinefunction ` is now deprecated
26772685 and will be removed in Python 3.16;
26782686 use :func: `inspect.iscoroutinefunction ` instead.
26792687 (Contributed by Jiahao Li and Kumar Aditya in :gh: `122875 `.)
26802688
2681- * :mod: `asyncio ` policy system is deprecated and will be removed in Python 3.16.
2689+ * The :mod: `asyncio ` policy system is deprecated
2690+ and will be removed in Python 3.16.
26822691 In particular, the following classes and functions are deprecated:
26832692
26842693 * :class: `asyncio.AbstractEventLoopPolicy `
@@ -2689,99 +2698,102 @@ Deprecated
26892698 * :func: `asyncio.set_event_loop_policy `
26902699
26912700 Users should use :func: `asyncio.run ` or :class: `asyncio.Runner ` with
2692- *loop_factory * to use the desired event loop implementation.
2701+ the *loop_factory * argument to use the desired event loop implementation.
26932702
2694- For example, to use :class: `asyncio.SelectorEventLoop ` on Windows::
2703+ For example, to use :class: `asyncio.SelectorEventLoop ` on Windows:
26952704
2696- import asyncio
2705+ .. code-block :: python
26972706
2698- async def main():
2699- ...
2707+ import asyncio
27002708
2701- asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)
2709+ async def main ():
2710+ ...
27022711
2703- (Contributed by Kumar Aditya in :gh: ` 127949 `. )
2712+ asyncio.run(main(), loop_factory = asyncio.SelectorEventLoop )
27042713
2705- * :mod: `builtins `:
2706- Passing a complex number as the *real * or *imag * argument in the
2707- :func: `complex ` constructor is now deprecated; it should only be passed
2708- as a single positional argument.
2709- (Contributed by Serhiy Storchaka in :gh: `109218 `.)
2714+ (Contributed by Kumar Aditya in :gh: `127949 `.)
27102715
27112716* :mod: `codecs `:
2712- :func: `codecs.open ` is now deprecated. Use :func: `open ` instead.
2717+ The :func: `codecs.open ` function is now deprecated,
2718+ and will be removed in a future version of Python.
2719+ Use :func: `open ` instead.
27132720 (Contributed by Inada Naoki in :gh: `133036 `.)
27142721
27152722* :mod: `ctypes `:
27162723
27172724 * On non-Windows platforms, setting :attr: `.Structure._pack_ ` to use a
2718- MSVC-compatible default memory layout is deprecated in favor of setting
2719- :attr: `.Structure._layout_ ` to ``'ms' ``.
2725+ MSVC-compatible default memory layout is now deprecated in favor of setting
2726+ :attr: `.Structure._layout_ ` to ``'ms' ``, and will be removed in Python 3.19 .
27202727 (Contributed by Petr Viktorin in :gh: `131747 `.)
27212728
2722- * Calling :func: `ctypes.POINTER ` on a string is deprecated.
2723- Use :ref: `ctypes-incomplete-types ` for self-referential structures.
2729+ * Calling :func: `ctypes.POINTER ` on a string is now deprecated.
2730+ Use :ref: `incomplete types <ctypes-incomplete-types >`
2731+ for self-referential structures.
27242732 Also, the internal ``ctypes._pointer_type_cache `` is deprecated.
27252733 See :func: `ctypes.POINTER ` for updated implementation details.
27262734 (Contributed by Sergey Myrianov in :gh: `100926 `.)
27272735
27282736* :mod: `functools `:
27292737 Calling the Python implementation of :func: `functools.reduce ` with *function *
2730- or *sequence * as keyword arguments is now deprecated.
2738+ or *sequence * as keyword arguments is now deprecated;
2739+ the parameters will be made positional-only in Python 3.16.
27312740 (Contributed by Kirill Podoprigora in :gh: `121676 `.)
27322741
27332742* :mod: `logging `:
2734- Support for custom logging handlers with the *strm * argument is deprecated
2735- and scheduled for removal in Python 3.16. Define handlers with the *stream *
2736- argument instead. (Contributed by Mariusz Felisiak in :gh: `115032 `.)
2743+ Support for custom logging handlers with the *strm * argument
2744+ is now deprecated and scheduled for removal in Python 3.16.
2745+ Define handlers with the *stream * argument instead.
2746+ (Contributed by Mariusz Felisiak in :gh: `115032 `.)
27372747
27382748* :mod: `mimetypes `:
2739- Valid extensions start with a '.' or are empty for
2749+ Valid extensions are either empty or must start with '.' for
27402750 :meth: `mimetypes.MimeTypes.add_type `.
27412751 Undotted extensions are deprecated and will
27422752 raise a :exc: `ValueError ` in Python 3.16.
27432753 (Contributed by Hugo van Kemenade in :gh: `75223 `.)
27442754
2745- * :mod: `!nturl2path `: This module is now deprecated. Call
2746- :func: ` urllib.request.url2pathname ` and :func: `~ urllib.request.pathname2url `
2747- instead.
2755+ * :mod: `!nturl2path `:
2756+ This module is now deprecated. Call :func: `urllib.request.url2pathname `
2757+ and :func: ` ~urllib.request.pathname2url ` instead.
27482758 (Contributed by Barney Gale in :gh: `125866 `.)
27492759
27502760* :mod: `os `:
2751- :term: `Soft deprecate <soft deprecated> ` :func: `os.popen ` and
2752- :func: `os.spawn* <os.spawnl> ` functions. They should no longer be used to
2753- write new code. The :mod: `subprocess ` module is recommended instead.
2761+ The :func: `os.popen ` and :func: `os.spawn* <os.spawnl> ` functions
2762+ are now :term: `soft deprecated `.
2763+ They should no longer be used to write new code.
2764+ The :mod: `subprocess ` module is recommended instead.
27542765 (Contributed by Victor Stinner in :gh: `120743 `.)
27552766
27562767* :mod: `pathlib `:
2757- :meth: `!pathlib.PurePath.as_uri ` is deprecated and will be removed in Python
2758- 3.19. Use :meth: `pathlib.Path.as_uri ` instead.
2768+ :meth: `!pathlib.PurePath.as_uri ` is now deprecated
2769+ and scheduled for removal in Python 3.19.
2770+ Use :meth: `pathlib.Path.as_uri ` instead.
27592771 (Contributed by Barney Gale in :gh: `123599 `.)
27602772
27612773* :mod: `pdb `:
27622774 The undocumented ``pdb.Pdb.curframe_locals `` attribute is now a deprecated
2763- read-only property. The low overhead dynamic frame locals access added in
2764- Python 3.13 by PEP 667 means the frame locals cache reference previously
2765- stored in this attribute is no longer needed. Derived debuggers should access
2775+ read-only property, which will be removed in a future version of Python.
2776+ The low overhead dynamic frame locals access added in Python 3.13 by :pep: `667 `
2777+ means the frame locals cache reference previously stored in this attribute
2778+ is no longer needed. Derived debuggers should access
27662779 ``pdb.Pdb.curframe.f_locals `` directly in Python 3.13 and later versions.
27672780 (Contributed by Tian Gao in :gh: `124369 ` and :gh: `125951 `.)
27682781
27692782* :mod: `symtable `:
2770- Deprecate :meth: `symtable.Class.get_methods ` due to the lack of interest.
2783+ Deprecate :meth: `symtable.Class.get_methods ` due to the lack of interest,
2784+ scheduled for removal in Python 3.16.
27712785 (Contributed by Bénédikt Tran in :gh: `119698 `.)
27722786
27732787* :mod: `tkinter `:
27742788 The :class: `!tkinter.Variable ` methods :meth: `!trace_variable `,
27752789 :meth: `!trace_vdelete ` and :meth: `!trace_vinfo ` are now deprecated.
2776- Use :meth: `!trace_add `, :meth: `!trace_remove ` and :meth: `!trace_info `
2777- instead.
2790+ Use :meth: `!trace_add `, :meth: `!trace_remove ` and :meth: `!trace_info ` instead.
27782791 (Contributed by Serhiy Storchaka in :gh: `120220 `.)
27792792
27802793* :mod: `urllib.parse `:
27812794 Accepting objects with false values (like ``0 `` and ``[] ``) except empty
2782- strings, byte-like objects and ``None `` in :mod: `urllib.parse ` functions
2783- :func: `~urllib.parse.parse_qsl ` and :func: `~urllib.parse.parse_qs ` is now
2784- deprecated.
2795+ strings, bytes-like objects and ``None `` in :func: `~urllib.parse.parse_qsl `
2796+ and :func: `~urllib.parse.parse_qs ` is now deprecated.
27852797 (Contributed by Serhiy Storchaka in :gh: `116897 `.)
27862798
27872799.. Add deprecations above alphabetically, not here at the end.
0 commit comments