@@ -2660,25 +2660,34 @@ urllib
2660
2660
Deprecated
2661
2661
==========
2662
2662
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
+
2663
2671
* :mod: `argparse `:
2664
2672
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.
2668
2675
(Contributed by Savannah Ostrowski in :gh: `125563 `.)
2676
+
2669
2677
* 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.
2672
2680
(Contributed by Serhiy Storchaka in :gh: `58032 `.)
2673
2681
2674
2682
* :mod: `asyncio `:
2675
2683
2676
- * :func: `!asyncio.iscoroutinefunction ` is deprecated
2684
+ * The :func: `!asyncio.iscoroutinefunction ` is now deprecated
2677
2685
and will be removed in Python 3.16;
2678
2686
use :func: `inspect.iscoroutinefunction ` instead.
2679
2687
(Contributed by Jiahao Li and Kumar Aditya in :gh: `122875 `.)
2680
2688
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.
2682
2691
In particular, the following classes and functions are deprecated:
2683
2692
2684
2693
* :class: `asyncio.AbstractEventLoopPolicy `
@@ -2689,99 +2698,102 @@ Deprecated
2689
2698
* :func: `asyncio.set_event_loop_policy `
2690
2699
2691
2700
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.
2693
2702
2694
- For example, to use :class: `asyncio.SelectorEventLoop ` on Windows::
2703
+ For example, to use :class: `asyncio.SelectorEventLoop ` on Windows:
2695
2704
2696
- import asyncio
2705
+ .. code-block :: python
2697
2706
2698
- async def main():
2699
- ...
2707
+ import asyncio
2700
2708
2701
- asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)
2709
+ async def main ():
2710
+ ...
2702
2711
2703
- (Contributed by Kumar Aditya in :gh: ` 127949 `. )
2712
+ asyncio.run(main(), loop_factory = asyncio.SelectorEventLoop )
2704
2713
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 `.)
2710
2715
2711
2716
* :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.
2713
2720
(Contributed by Inada Naoki in :gh: `133036 `.)
2714
2721
2715
2722
* :mod: `ctypes `:
2716
2723
2717
2724
* 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 .
2720
2727
(Contributed by Petr Viktorin in :gh: `131747 `.)
2721
2728
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.
2724
2732
Also, the internal ``ctypes._pointer_type_cache `` is deprecated.
2725
2733
See :func: `ctypes.POINTER ` for updated implementation details.
2726
2734
(Contributed by Sergey Myrianov in :gh: `100926 `.)
2727
2735
2728
2736
* :mod: `functools `:
2729
2737
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.
2731
2740
(Contributed by Kirill Podoprigora in :gh: `121676 `.)
2732
2741
2733
2742
* :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 `.)
2737
2747
2738
2748
* :mod: `mimetypes `:
2739
- Valid extensions start with a '.' or are empty for
2749
+ Valid extensions are either empty or must start with '.' for
2740
2750
:meth: `mimetypes.MimeTypes.add_type `.
2741
2751
Undotted extensions are deprecated and will
2742
2752
raise a :exc: `ValueError ` in Python 3.16.
2743
2753
(Contributed by Hugo van Kemenade in :gh: `75223 `.)
2744
2754
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.
2748
2758
(Contributed by Barney Gale in :gh: `125866 `.)
2749
2759
2750
2760
* :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.
2754
2765
(Contributed by Victor Stinner in :gh: `120743 `.)
2755
2766
2756
2767
* :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.
2759
2771
(Contributed by Barney Gale in :gh: `123599 `.)
2760
2772
2761
2773
* :mod: `pdb `:
2762
2774
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
2766
2779
``pdb.Pdb.curframe.f_locals `` directly in Python 3.13 and later versions.
2767
2780
(Contributed by Tian Gao in :gh: `124369 ` and :gh: `125951 `.)
2768
2781
2769
2782
* :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.
2771
2785
(Contributed by Bénédikt Tran in :gh: `119698 `.)
2772
2786
2773
2787
* :mod: `tkinter `:
2774
2788
The :class: `!tkinter.Variable ` methods :meth: `!trace_variable `,
2775
2789
: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.
2778
2791
(Contributed by Serhiy Storchaka in :gh: `120220 `.)
2779
2792
2780
2793
* :mod: `urllib.parse `:
2781
2794
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.
2785
2797
(Contributed by Serhiy Storchaka in :gh: `116897 `.)
2786
2798
2787
2799
.. Add deprecations above alphabetically, not here at the end.
0 commit comments