@@ -615,12 +615,18 @@ asyncio
615
615
These are primarily intended for internal use,
616
616
notably by :class: `~asyncio.TaskGroup `.
617
617
618
+
619
+ .. _whatsnew311-contextlib :
620
+
618
621
contextlib
619
622
----------
620
623
621
- Added non parallel-safe :func: `~contextlib.chdir ` context manager to change
622
- the current working directory and then restore it on exit. Simple wrapper
623
- around :func: `~os.chdir `. (Contributed by Filipe Laíns in :issue: `25625 `)
624
+ * Added non parallel-safe :func: `~contextlib.chdir ` context manager to change
625
+ the current working directory and then restore it on exit. Simple wrapper
626
+ around :func: `~os.chdir `. (Contributed by Filipe Laíns in :issue: `25625 `)
627
+
628
+
629
+ .. _whatsnew311-dataclasses :
624
630
625
631
dataclasses
626
632
-----------
@@ -630,11 +636,15 @@ dataclasses
630
636
:class: `dict `, :class: `list ` or :class: `set `. (Contributed by Eric V. Smith in
631
637
:issue: `44674 `.)
632
638
639
+
640
+ .. _whatsnew311-datetime :
641
+
633
642
datetime
634
643
--------
635
644
636
645
* Add :attr: `datetime.UTC `, a convenience alias for
637
646
:attr: `datetime.timezone.utc `. (Contributed by Kabir Kwatra in :gh: `91973 `.)
647
+
638
648
* :meth: `datetime.date.fromisoformat `, :meth: `datetime.time.fromisoformat ` and
639
649
:meth: `datetime.datetime.fromisoformat ` can now be used to parse most ISO 8601
640
650
formats (barring only those that support fractional hours and minutes).
659
669
(used by :func: `str `, :func: `format ` and :term: `f-string `\s ).
660
670
661
671
* Changed :class: `~enum.IntEnum `, :class: `~enum.IntFlag ` and :class: `~enum.StrEnum `
662
- to now inherit from :class: `ReprEnum `,
672
+ to now inherit from :class: `~enum. ReprEnum `,
663
673
so their :func: `str ` output now matches :func: `format `
664
674
(both ``str(AnIntEnum.ONE) `` and ``format(AnIntEnum.ONE) `` return ``'1' ``,
665
675
whereas before ``str(AnIntEnum.ONE) `` returned ``'AnIntEnum.ONE' ``.
@@ -709,6 +719,18 @@ enum
709
719
inverted flags are coerced to their positive equivalent.
710
720
711
721
722
+ .. _whatsnew311-fcntl :
723
+
724
+ fcntl
725
+ -----
726
+
727
+ * On FreeBSD, the :data: `!F_DUP2FD ` and :data: `!F_DUP2FD_CLOEXEC ` flags respectively
728
+ are supported, the former equals to ``dup2 `` usage while the latter set
729
+ the ``FD_CLOEXEC `` flag in addition.
730
+
731
+
732
+ .. _whatsnew311-fractions :
733
+
712
734
fractions
713
735
---------
714
736
@@ -719,6 +741,9 @@ fractions
719
741
that an ``isinstance(some_fraction, typing.SupportsInt) `` check passes.
720
742
(Contributed by Mark Dickinson in :issue: `44547 `.)
721
743
744
+
745
+ .. _whatsnew311-functools :
746
+
722
747
functools
723
748
---------
724
749
@@ -749,6 +774,9 @@ functools
749
774
750
775
(Contributed by Yurii Karabas in :issue: `46014 `.)
751
776
777
+
778
+ .. _whatsnew311-hashlib :
779
+
752
780
hashlib
753
781
-------
754
782
@@ -767,6 +795,9 @@ hashlib
767
795
of files or file-like objects.
768
796
(Contributed by Christian Heimes in :gh: `89313 `.)
769
797
798
+
799
+ .. _whatsnew311-idle :
800
+
770
801
IDLE and idlelib
771
802
----------------
772
803
@@ -804,6 +835,9 @@ inspect
804
835
805
836
(Contributed by Pablo Galindo in :gh: `88116 `.)
806
837
838
+
839
+ .. _whatsnew311-locale :
840
+
807
841
locale
808
842
------
809
843
@@ -831,6 +865,8 @@ logging
831
865
(Contributed by Kirill Pinchuk in :gh: `88457 `.)
832
866
833
867
868
+ .. _whatsnew311-math :
869
+
834
870
math
835
871
----
836
872
850
886
(Contributed by Victor Stinner in :issue: `46917 `.)
851
887
852
888
889
+ .. _whatsnew311-operator :
890
+
853
891
operator
854
892
--------
855
893
@@ -858,6 +896,8 @@ operator
858
896
(Contributed by Antony Lee in :issue: `44019 `.)
859
897
860
898
899
+ .. _whatsnew311-os :
900
+
861
901
os
862
902
--
863
903
866
906
(Contributed by Dong-hee Na in :issue: `44611 `.)
867
907
868
908
909
+ .. _whatsnew311-pathlib :
910
+
869
911
pathlib
870
912
-------
871
913
@@ -874,20 +916,28 @@ pathlib
874
916
:data: `~os.sep ` or :data: `~os.altsep `.
875
917
(Contributed by Eisuke Kawasima in :issue: `22276 ` and :issue: `33392 `.)
876
918
919
+
920
+ .. _whatsnew311-re :
921
+
877
922
re
878
923
--
879
924
880
925
* Atomic grouping (``(?>...) ``) and possessive quantifiers (``*+ ``, ``++ ``,
881
926
``?+ ``, ``{m,n}+ ``) are now supported in regular expressions.
882
927
(Contributed by Jeffrey C. Jacobs and Serhiy Storchaka in :issue: `433030 `.)
883
928
929
+
930
+ .. _whatsnew311-shutil :
931
+
884
932
shutil
885
933
------
886
934
887
935
* Add optional parameter *dir_fd * in :func: `shutil.rmtree `.
888
936
(Contributed by Serhiy Storchaka in :issue: `46245 `.)
889
937
890
938
939
+ .. _whatsnew311-socket :
940
+
891
941
socket
892
942
------
893
943
@@ -899,6 +949,9 @@ socket
899
949
instead of only raising the last error.
900
950
(Contributed by Irit Katriel in :issue: `29980 `.)
901
951
952
+
953
+ .. _whatsnew311-sqlite3 :
954
+
902
955
sqlite3
903
956
-------
904
957
@@ -962,13 +1015,15 @@ string
962
1015
(Contributed by Ben Kehoe in :gh: `90465 `.)
963
1016
964
1017
1018
+ .. _whatsnew311-sys :
1019
+
965
1020
sys
966
1021
---
967
1022
968
1023
* :func: `sys.exc_info ` now derives the ``type `` and ``traceback `` fields
969
1024
from the ``value `` (the exception instance), so when an exception is
970
1025
modified while it is being handled, the changes are reflected in
971
- the results of subsequent calls to :func: `exc_info `.
1026
+ the results of subsequent calls to :func: `! exc_info `.
972
1027
(Contributed by Irit Katriel in :issue: `45711 `.)
973
1028
974
1029
* Add :func: `sys.exception ` which returns the active exception instance
979
1034
(Contributed by Victor Stinner in :gh: `57684 `.)
980
1035
981
1036
1037
+ .. _whatsnew311-sysconfig :
1038
+
982
1039
sysconfig
983
1040
---------
984
1041
@@ -1009,6 +1066,8 @@ tempfile
1009
1066
(Contributed by Carey Metcalfe in :gh: `70363 `.)
1010
1067
1011
1068
1069
+ .. _whatsnew311-threading :
1070
+
1012
1071
threading
1013
1072
---------
1014
1073
@@ -1020,6 +1079,8 @@ threading
1020
1079
(Contributed by Victor Stinner in :issue: `41710 `.)
1021
1080
1022
1081
1082
+ .. _whatsnew311-time :
1083
+
1023
1084
time
1024
1085
----
1025
1086
@@ -1037,6 +1098,18 @@ time
1037
1098
(Contributed by Benjamin Szőke, Dong-hee Na, Eryk Sun and Victor Stinner in :issue: `21302 ` and :issue: `45429 `.)
1038
1099
1039
1100
1101
+ .. _whatsnew311-tkinter :
1102
+
1103
+ tkinter
1104
+ -------
1105
+
1106
+ * Added method ``info_patchlevel() `` which returns the exact version of
1107
+ the Tcl library as a named tuple similar to :data: `sys.version_info `.
1108
+ (Contributed by Serhiy Storchaka in :gh: `91827 `.)
1109
+
1110
+
1111
+ .. _whatsnew311-traceback :
1112
+
1040
1113
traceback
1041
1114
---------
1042
1115
@@ -1050,6 +1123,8 @@ traceback
1050
1123
(Contributed by Irit Katriel in :issue: `33809 `.)
1051
1124
1052
1125
1126
+ .. _whatsnew311-typing :
1127
+
1053
1128
typing
1054
1129
------
1055
1130
@@ -1090,7 +1165,7 @@ For major changes, see :ref:`new-feat-related-type-hints-311`.
1090
1165
to clear all registered overloads of a function.
1091
1166
(Contributed by Jelle Zijlstra in :gh: `89263 `.)
1092
1167
1093
- * The :meth: `__init__ ` method of :class: `~typing.Protocol ` subclasses
1168
+ * The :meth: `~object. __init__ ` method of :class: `~typing.Protocol ` subclasses
1094
1169
is now preserved. (Contributed by Adrian Garcia Badarasco in :gh: `88970 `.)
1095
1170
1096
1171
* The representation of empty tuple types (``Tuple[()] ``) is simplified.
@@ -1119,19 +1194,16 @@ For major changes, see :ref:`new-feat-related-type-hints-311`.
1119
1194
by Nikita Sobolev in :gh: `90729 `.)
1120
1195
1121
1196
1122
- tkinter
1123
- -------
1124
-
1125
- * Added method ``info_patchlevel() `` which returns the exact version of
1126
- the Tcl library as a named tuple similar to :data: `sys.version_info `.
1127
- (Contributed by Serhiy Storchaka in :gh: `91827 `.)
1128
-
1197
+ .. _whatsnew311-unicodedata :
1129
1198
1130
1199
unicodedata
1131
1200
-----------
1132
1201
1133
- * The Unicode database has been updated to version 14.0.0. (Contributed by Benjamin Peterson in :issue: `45190 `).
1202
+ * The Unicode database has been updated to version 14.0.0.
1203
+ (Contributed by Benjamin Peterson in :issue: `45190 `).
1204
+
1134
1205
1206
+ .. _whatsnew311-unittest :
1135
1207
1136
1208
unittest
1137
1209
--------
@@ -1145,6 +1217,8 @@ unittest
1145
1217
(Contributed by Serhiy Storchaka in :issue: `45046 `.)
1146
1218
1147
1219
1220
+ .. _whatsnew311-venv :
1221
+
1148
1222
venv
1149
1223
----
1150
1224
@@ -1158,6 +1232,9 @@ venv
1158
1232
Third party code that also creates new virtual environments should do the same.
1159
1233
(Contributed by Miro Hrončok in :issue: `45413 `.)
1160
1234
1235
+
1236
+ .. _whatsnew311-warnings :
1237
+
1161
1238
warnings
1162
1239
--------
1163
1240
@@ -1184,14 +1261,6 @@ zipfile
1184
1261
(Contributed by Miguel Brito in :gh: `88261 `.)
1185
1262
1186
1263
1187
- fcntl
1188
- -----
1189
-
1190
- * On FreeBSD, the :attr: `F_DUP2FD ` and :attr: `F_DUP2FD_CLOEXEC ` flags respectively
1191
- are supported, the former equals to ``dup2 `` usage while the latter set
1192
- the ``FD_CLOEXEC `` flag in addition.
1193
-
1194
-
1195
1264
.. _whatsnew311-optimizations :
1196
1265
1197
1266
Optimizations
0 commit comments