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