@@ -580,19 +580,10 @@ asyncio
580
580
:class: `asyncio.ThreadedChildWatcher `.
581
581
(Contributed by Kumar Aditya in :gh: `98024 `.)
582
582
583
- * The child watcher classes :class: `asyncio.MultiLoopChildWatcher `,
584
- :class: `asyncio.FastChildWatcher `, :class: `asyncio.AbstractChildWatcher `
585
- and :class: `asyncio.SafeChildWatcher ` are deprecated and
586
- will be removed in Python 3.14. It is recommended to not manually
587
- configure a child watcher as the event loop now uses the best available
588
- child watcher for each platform (:class: `asyncio.PidfdChildWatcher `
589
- if supported and :class: `asyncio.ThreadedChildWatcher ` otherwise).
590
- (Contributed by Kumar Aditya in :gh: `94597 `.)
591
-
592
- * :func: `asyncio.set_child_watcher `, :func: `asyncio.get_child_watcher `,
593
- :meth: `asyncio.AbstractEventLoopPolicy.set_child_watcher ` and
594
- :meth: `asyncio.AbstractEventLoopPolicy.get_child_watcher ` are deprecated
595
- and will be removed in Python 3.14.
583
+ * The event loop now uses the best available child watcher for each platform
584
+ (:class: `asyncio.PidfdChildWatcher ` if supported and
585
+ :class: `asyncio.ThreadedChildWatcher ` otherwise), so manually
586
+ configuring a child watcher is not recommended.
596
587
(Contributed by Kumar Aditya in :gh: `94597 `.)
597
588
598
589
* Add *loop_factory * parameter to :func: `asyncio.run ` to allow specifying
@@ -1046,15 +1037,52 @@ Demos and Tools
1046
1037
Deprecated
1047
1038
==========
1048
1039
1049
- * :mod: `asyncio `: The :meth: `~asyncio.get_event_loop ` method of the
1050
- default event loop policy now emits a :exc: `DeprecationWarning ` if there
1051
- is no current event loop set and it decides to create one.
1052
- (Contributed by Serhiy Storchaka and Guido van Rossum in :gh: `100160 `.)
1040
+ * :mod: `argparse `: The *type *, *choices *, and *metavar * parameters
1041
+ of :class: `!argparse.BooleanOptionalAction ` are deprecated
1042
+ and will be removed in 3.14.
1043
+ (Contributed by Nikita Sobolev in :gh: `92248 `.)
1044
+
1045
+ * :mod: `ast `: The following :mod: `ast ` features have been deprecated in documentation since
1046
+ Python 3.8, now cause a :exc: `DeprecationWarning ` to be emitted at runtime
1047
+ when they are accessed or used, and will be removed in Python 3.14:
1048
+
1049
+ * :class: `!ast.Num `
1050
+ * :class: `!ast.Str `
1051
+ * :class: `!ast.Bytes `
1052
+ * :class: `!ast.NameConstant `
1053
+ * :class: `!ast.Ellipsis `
1054
+
1055
+ Use :class: `ast.Constant ` instead.
1056
+ (Contributed by Serhiy Storchaka in :gh: `90953 `.)
1057
+
1058
+ * :mod: `asyncio `:
1059
+
1060
+ * The child watcher classes :class: `asyncio.MultiLoopChildWatcher `,
1061
+ :class: `asyncio.FastChildWatcher `, :class: `asyncio.AbstractChildWatcher `
1062
+ and :class: `asyncio.SafeChildWatcher ` are deprecated and
1063
+ will be removed in Python 3.14.
1064
+ (Contributed by Kumar Aditya in :gh: `94597 `.)
1065
+
1066
+ * :func: `asyncio.set_child_watcher `, :func: `asyncio.get_child_watcher `,
1067
+ :meth: `asyncio.AbstractEventLoopPolicy.set_child_watcher ` and
1068
+ :meth: `asyncio.AbstractEventLoopPolicy.get_child_watcher ` are deprecated
1069
+ and will be removed in Python 3.14.
1070
+ (Contributed by Kumar Aditya in :gh: `94597 `.)
1071
+
1072
+ * The :meth: `~asyncio.get_event_loop ` method of the
1073
+ default event loop policy now emits a :exc: `DeprecationWarning ` if there
1074
+ is no current event loop set and it decides to create one.
1075
+ (Contributed by Serhiy Storchaka and Guido van Rossum in :gh: `100160 `.)
1053
1076
1054
1077
* :mod: `calendar `: ``calendar.January `` and ``calendar.February `` constants are deprecated and
1055
1078
replaced by :data: `calendar.JANUARY ` and :data: `calendar.FEBRUARY `.
1056
1079
(Contributed by Prince Roshan in :gh: `103636 `.)
1057
1080
1081
+ * :mod: `collections.abc `: Deprecated :class: `collections.abc.ByteString `.
1082
+ Prefer :class: `Sequence ` or :class: `collections.abc.Buffer `.
1083
+ For use in typing, prefer a union, like ``bytes | bytearray ``, or :class: `collections.abc.Buffer `.
1084
+ (Contributed by Shantanu Jain in :gh: `91896 `.)
1085
+
1058
1086
* :mod: `datetime `: :class: `datetime.datetime `'s :meth: `~datetime.datetime.utcnow ` and
1059
1087
:meth: `~datetime.datetime.utcfromtimestamp ` are deprecated and will be
1060
1088
removed in a future version. Instead, use timezone-aware objects to represent
@@ -1063,42 +1091,88 @@ Deprecated
1063
1091
:const: `datetime.UTC `.
1064
1092
(Contributed by Paul Ganssle in :gh: `103857 `.)
1065
1093
1066
- * :mod: `os `: The ``st_ctime `` fields return by :func: `os.stat ` and :func: `os.lstat ` on
1067
- Windows are deprecated. In a future release, they will contain the last
1068
- metadata change time, consistent with other platforms. For now, they still
1069
- contain the creation time, which is also available in the new ``st_birthtime ``
1070
- field. (Contributed by Steve Dower in :gh: `99726 `.)
1071
-
1072
- * :mod: `os `: On POSIX platforms, :func: `os.fork ` can now raise a
1073
- :exc: `DeprecationWarning ` when it can detect being called from a
1074
- multithreaded process. There has always been a fundamental incompatibility
1075
- with the POSIX platform when doing so. Even if such code *appeared * to work.
1076
- We added the warning to to raise awareness as issues encounted by code doing
1077
- this are becoming more frequent. See the :func: `os.fork ` documentation for
1078
- more details along with `this discussion on fork being incompatible with threads
1079
- <https://discuss.python.org/t/33555> `_ for *why * we're now surfacing this
1080
- longstanding platform compatibility problem to developers.
1094
+ * :mod: `email `: Deprecate the *isdst * parameter in :func: `email.utils.localtime `.
1095
+ (Contributed by Alan Williams in :gh: `72346 `.)
1096
+
1097
+ * :mod: `importlib.abc `: Deprecated the following classes, scheduled for removal in
1098
+ Python 3.14:
1099
+
1100
+ * :class: `!importlib.abc.ResourceReader `
1101
+ * :class: `!importlib.abc.Traversable `
1102
+ * :class: `!importlib.abc.TraversableResources `
1103
+
1104
+ Use :mod: `importlib.resources.abc ` classes instead:
1105
+
1106
+ * :class: `importlib.resources.abc.Traversable `
1107
+ * :class: `importlib.resources.abc.TraversableResources `
1108
+
1109
+ (Contributed by Jason R. Coombs and Hugo van Kemenade in :gh: `93963 `.)
1110
+
1111
+ * :mod: `itertools `: Deprecate the support for copy, deepcopy, and pickle operations,
1112
+ which is undocumented, inefficient, historically buggy, and inconsistent.
1113
+ This will be removed in 3.14 for a significant reduction in code
1114
+ volume and maintenance burden.
1115
+ (Contributed by Raymond Hettinger in :gh: `101588 `.)
1116
+
1117
+ * :mod: `multiprocessing `: In Python 3.14, the default :mod: `multiprocessing `
1118
+ start method will change to a safer one on Linux, BSDs,
1119
+ and other non-macOS POSIX platforms where ``'fork' `` is currently
1120
+ the default (:gh: `84559 `). Adding a runtime warning about this was deemed too
1121
+ disruptive as the majority of code is not expected to care. Use the
1122
+ :func: `~multiprocessing.get_context ` or
1123
+ :func: `~multiprocessing.set_start_method ` APIs to explicitly specify when
1124
+ your code *requires * ``'fork' ``. See :ref: `contexts and start methods
1125
+ <multiprocessing-start-methods>`.
1126
+
1127
+ * :mod: `pkgutil `: :func: `pkgutil.find_loader ` and :func: `pkgutil.get_loader `
1128
+ are deprecated and will be removed in Python 3.14;
1129
+ use :func: `importlib.util.find_spec ` instead.
1130
+ (Contributed by Nikita Sobolev in :gh: `97850 `.)
1131
+
1132
+ * :mod: `pty `: The module has two undocumented ``master_open() `` and ``slave_open() ``
1133
+ functions that have been deprecated since Python 2 but only gained a
1134
+ proper :exc: `DeprecationWarning ` in 3.12. Remove them in 3.14.
1135
+ (Contributed by Soumendra Ganguly and Gregory P. Smith in :gh: `85984 `.)
1136
+
1137
+ * :mod: `os `:
1138
+
1139
+ * The ``st_ctime `` fields return by :func: `os.stat ` and :func: `os.lstat ` on
1140
+ Windows are deprecated. In a future release, they will contain the last
1141
+ metadata change time, consistent with other platforms. For now, they still
1142
+ contain the creation time, which is also available in the new ``st_birthtime ``
1143
+ field. (Contributed by Steve Dower in :gh: `99726 `.)
1144
+
1145
+ * On POSIX platforms, :func: `os.fork ` can now raise a
1146
+ :exc: `DeprecationWarning ` when it can detect being called from a
1147
+ multithreaded process. There has always been a fundamental incompatibility
1148
+ with the POSIX platform when doing so. Even if such code *appeared * to work.
1149
+ We added the warning to to raise awareness as issues encounted by code doing
1150
+ this are becoming more frequent. See the :func: `os.fork ` documentation for
1151
+ more details along with `this discussion on fork being incompatible with threads
1152
+ <https://discuss.python.org/t/33555> `_ for *why * we're now surfacing this
1153
+ longstanding platform compatibility problem to developers.
1081
1154
1082
1155
When this warning appears due to usage of :mod: `multiprocessing ` or
1083
1156
:mod: `concurrent.futures ` the fix is to use a different
1084
1157
:mod: `multiprocessing ` start method such as ``"spawn" `` or ``"forkserver" ``.
1085
1158
1086
- * :mod: `shutil `: The *onerror * argument of :func: `shutil.rmtree ` is deprecated as will be removed
1159
+ * :mod: `shutil `: The *onerror * argument of :func: `shutil.rmtree ` is deprecated and will be removed
1087
1160
in Python 3.14. Use *onexc * instead. (Contributed by Irit Katriel in :gh: `102828 `.)
1088
1161
1089
1162
* :mod: `sqlite3 `:
1090
- * :ref: `default adapters and converters
1091
- <sqlite3-default-converters>` are now deprecated.
1092
- Instead, use the :ref: `sqlite3-adapter-converter-recipes `
1093
- and tailor them to your needs.
1094
- (Contributed by Erlend E. Aasland in :gh: `90016 `.)
1095
-
1096
- * In :meth: `~sqlite3.Cursor.execute `, :exc: `DeprecationWarning ` is now emitted
1097
- when :ref: `named placeholders <sqlite3-placeholders >` are used together with
1098
- parameters supplied as a :term: `sequence ` instead of as a :class: `dict `.
1099
- Starting from Python 3.14, using named placeholders with parameters supplied
1100
- as a sequence will raise a :exc: `~sqlite3.ProgrammingError `.
1101
- (Contributed by Erlend E. Aasland in :gh: `101698 `.)
1163
+
1164
+ * :ref: `default adapters and converters
1165
+ <sqlite3-default-converters>` are now deprecated.
1166
+ Instead, use the :ref: `sqlite3-adapter-converter-recipes `
1167
+ and tailor them to your needs.
1168
+ (Contributed by Erlend E. Aasland in :gh: `90016 `.)
1169
+
1170
+ * In :meth: `~sqlite3.Cursor.execute `, :exc: `DeprecationWarning ` is now emitted
1171
+ when :ref: `named placeholders <sqlite3-placeholders >` are used together with
1172
+ parameters supplied as a :term: `sequence ` instead of as a :class: `dict `.
1173
+ Starting from Python 3.14, using named placeholders with parameters supplied
1174
+ as a sequence will raise a :exc: `~sqlite3.ProgrammingError `.
1175
+ (Contributed by Erlend E. Aasland in :gh: `101698 `.)
1102
1176
1103
1177
* :mod: `sys `: The :data: `sys.last_type `, :data: `sys.last_value ` and :data: `sys.last_traceback `
1104
1178
fields are deprecated. Use :data: `sys.last_exc ` instead.
@@ -1108,16 +1182,24 @@ Deprecated
1108
1182
Python 3.14, when ``'data' `` filter will become the default.
1109
1183
See :ref: `tarfile-extraction-filter ` for details.
1110
1184
1111
- * :mod: `typing `: :class: `typing.Hashable ` and :class: `typing.Sized ` aliases for :class: `collections.abc.Hashable `
1112
- and :class: `collections.abc.Sized `. (:gh: `94309 `.)
1185
+ * :mod: `typing `:
1186
+
1187
+ * :class: `typing.Hashable ` and :class: `typing.Sized ` aliases for :class: `collections.abc.Hashable `
1188
+ and :class: `collections.abc.Sized `. (:gh: `94309 `.)
1189
+
1190
+ * :class: `typing.ByteString `, deprecated since Python 3.9, now causes a
1191
+ :exc: `DeprecationWarning ` to be emitted when it is used.
1192
+ (Contributed by Alex Waygood in :gh: `91896 `.)
1113
1193
1114
1194
* :mod: `xml.etree.ElementTree `: The module now emits :exc: `DeprecationWarning `
1115
1195
when testing the truth value of an :class: `xml.etree.ElementTree.Element `.
1116
1196
Before, the Python implementation emitted :exc: `FutureWarning `, and the C
1117
1197
implementation emitted nothing.
1198
+ (Contributed by Jacob Walls in :gh: `83122 `.)
1118
1199
1119
- * The 3-arg signatures (type, value, traceback) of :meth: `~coroutine.throw `,
1120
- :meth: `~generator.throw ` and :meth: `~agen.athrow ` are deprecated and
1200
+ * The 3-arg signatures (type, value, traceback) of :meth: `coroutine throw()
1201
+ <coroutine.throw> `, :meth: `generator throw() <generator.throw> ` and
1202
+ :meth: `async generator throw() <agen.athrow> ` are deprecated and
1121
1203
may be removed in a future version of Python. Use the single-arg versions
1122
1204
of these functions instead. (Contributed by Ofey Chan in :gh: `89874 `.)
1123
1205
@@ -1126,12 +1208,21 @@ Deprecated
1126
1208
:exc: `ImportWarning `).
1127
1209
(Contributed by Brett Cannon in :gh: `65961 `.)
1128
1210
1211
+ * Setting ``__package__ `` or ``__cached__ `` on a module is deprecated,
1212
+ and will cease to be set or taken into consideration by the import system in Python 3.14.
1213
+ (Contributed by Brett Cannon in :gh: `65961 `.)
1214
+
1129
1215
* The bitwise inversion operator (``~ ``) on bool is deprecated. It will throw an
1130
1216
error in Python 3.14. Use ``not `` for logical negation of bools instead.
1131
1217
In the rare case that you really need the bitwise inversion of the underlying
1132
- ``int ``, convert to int explicitly with ``~int(x) ``. (Contributed by Tim Hoffmann
1218
+ ``int ``, convert to int explicitly: ``~int(x) ``. (Contributed by Tim Hoffmann
1133
1219
in :gh: `103487 `.)
1134
1220
1221
+ * Accessing ``co_lnotab `` on code objects was deprecated in Python 3.10 via :pep: `626 `,
1222
+ but it only got a proper :exc: `DeprecationWarning ` in 3.12,
1223
+ therefore it will be removed in 3.14.
1224
+ (Contributed by Nikita Sobolev in :gh: `101866 `.)
1225
+
1135
1226
Pending Removal in Python 3.13
1136
1227
------------------------------
1137
1228
@@ -1179,90 +1270,62 @@ APIs:
1179
1270
Pending Removal in Python 3.14
1180
1271
------------------------------
1181
1272
1273
+ The following APIs have been deprecated
1274
+ and will be removed in Python 3.14.
1275
+
1182
1276
* :mod: `argparse `: The *type *, *choices *, and *metavar * parameters
1183
- of :class: `!argparse.BooleanOptionalAction ` are deprecated
1184
- and will be removed in 3.14.
1185
- (Contributed by Nikita Sobolev in :gh: `92248 `.)
1277
+ of :class: `!argparse.BooleanOptionalAction `
1186
1278
1187
- * :mod: `ast `: The following :mod: `ast ` features have been deprecated in documentation since
1188
- Python 3.8, now cause a :exc: `DeprecationWarning ` to be emitted at runtime
1189
- when they are accessed or used, and will be removed in Python 3.14:
1279
+ * :mod: `ast `:
1190
1280
1191
1281
* :class: `!ast.Num `
1192
1282
* :class: `!ast.Str `
1193
1283
* :class: `!ast.Bytes `
1194
1284
* :class: `!ast.NameConstant `
1195
1285
* :class: `!ast.Ellipsis `
1196
1286
1197
- Use :class: `ast.Constant ` instead.
1198
- (Contributed by Serhiy Storchaka in :gh: `90953 `.)
1287
+ * :mod: `asyncio `:
1199
1288
1200
- * :mod: `asyncio `: the *msg * parameter of both
1201
- :meth: `asyncio.Future.cancel ` and
1202
- :meth: `asyncio.Task.cancel ` (:gh: `90985 `)
1289
+ * :class: `!asyncio.MultiLoopChildWatcher `
1290
+ * :class: `!asyncio.FastChildWatcher `
1291
+ * :class: `!asyncio.AbstractChildWatcher `
1292
+ * :class: `!asyncio.SafeChildWatcher `
1293
+ * :func: `!asyncio.set_child_watcher `
1294
+ * :func: `!asyncio.get_child_watcher `,
1295
+ * :meth: `!asyncio.AbstractEventLoopPolicy.set_child_watcher `
1296
+ * :meth: `!asyncio.AbstractEventLoopPolicy.get_child_watcher `
1203
1297
1204
- * :mod: `collections.abc `: Deprecated :class: `collections.abc.ByteString `.
1205
- Prefer :class: `Sequence ` or :class: `collections.abc.Buffer `.
1206
- For use in typing, prefer a union, like ``bytes | bytearray ``, or :class: `collections.abc.Buffer `.
1207
- (Contributed by Shantanu Jain in :gh: `91896 `.)
1298
+ * :mod: `collections.abc `: :class: `!collections.abc.ByteString `.
1208
1299
1209
- * :mod: `email `: Deprecated the *isdst * parameter in :func: `email.utils.localtime `.
1210
- (Contributed by Alan Williams in :gh: `72346 `.)
1300
+ * :mod: `email `: the *isdst * parameter in :func: `email.utils.localtime `.
1211
1301
1212
- * :mod: `importlib.abc `: Deprecated the following classes, scheduled for removal in
1213
- Python 3.14:
1302
+ * :mod: `importlib.abc `:
1214
1303
1215
1304
* :class: `!importlib.abc.ResourceReader `
1216
1305
* :class: `!importlib.abc.Traversable `
1217
1306
* :class: `!importlib.abc.TraversableResources `
1218
1307
1219
- Use :mod: `importlib.resources.abc ` classes instead:
1308
+ * :mod: `itertools `: Support for copy, deepcopy, and pickle operations.
1220
1309
1221
- * :class: `importlib.resources.abc.Traversable `
1222
- * :class: `importlib.resources.abc.TraversableResources `
1223
-
1224
- (Contributed by Jason R. Coombs and Hugo van Kemenade in :gh: `93963 `.)
1225
-
1226
- * :mod: `itertools `: The module had undocumented, inefficient, historically buggy,
1227
- and inconsistent support for copy, deepcopy, and pickle operations.
1228
- This will be removed in 3.14 for a significant reduction in code
1229
- volume and maintenance burden.
1230
- (Contributed by Raymond Hettinger in :gh: `101588 `.)
1310
+ * :mod: `pkgutil `:
1231
1311
1232
- * :mod: `multiprocessing `: The default :mod: `multiprocessing ` start method will change to a safer one on
1233
- Linux, BSDs, and other non-macOS POSIX platforms where ``'fork' `` is currently
1234
- the default (:gh: `84559 `). Adding a runtime warning about this was deemed too
1235
- disruptive as the majority of code is not expected to care. Use the
1236
- :func: `~multiprocessing.get_context ` or
1237
- :func: `~multiprocessing.set_start_method ` APIs to explicitly specify when
1238
- your code *requires * ``'fork' ``. See :ref: `multiprocessing-start-methods `.
1312
+ * :func: `!pkgutil.find_loader `
1313
+ * :func: `!pkgutil.get_loader `.
1239
1314
1240
- * :mod: `pkgutil `: :func: `pkgutil.find_loader ` and :func: `pkgutil.get_loader `
1241
- now raise :exc: `DeprecationWarning `;
1242
- use :func: `importlib.util.find_spec ` instead.
1243
- (Contributed by Nikita Sobolev in :gh: `97850 `.)
1315
+ * :mod: `pty `:
1244
1316
1245
- * :mod: `pty `: The module has two undocumented ``master_open() `` and ``slave_open() ``
1246
- functions that have been deprecated since Python 2 but only gained a
1247
- proper :exc: `DeprecationWarning ` in 3.12. Remove them in 3.14.
1317
+ * :func: `!pty.master_open `
1318
+ * :func: `!pty.slave_open `
1248
1319
1249
- * :mod: `shutil `: The *onerror * argument of :func: `shutil.rmtree ` is deprecated in 3.12,
1250
- and will be removed in 3.14.
1320
+ * :mod: `shutil `: The *onerror * argument of :func: `shutil.rmtree `
1251
1321
1252
- * :mod: `typing `: :class: `typing.ByteString `, deprecated since Python 3.9, now causes a
1253
- :exc: `DeprecationWarning ` to be emitted when it is used.
1322
+ * :mod: `typing `: :class: `!typing.ByteString `
1254
1323
1255
- * :mod: `xml.etree.ElementTree `: Testing the truth value of an :class: `xml.etree.ElementTree.Element `
1256
- is deprecated and will raise an exception in Python 3.14.
1324
+ * :mod: `xml.etree.ElementTree `: Testing the truth value of an :class: `xml.etree.ElementTree.Element `.
1257
1325
1258
- * ``__package__ `` and ``__cached__ `` will cease to be set or taken
1259
- into consideration by the import system (:gh: `97879 `).
1326
+ * The ``__package__ `` and ``__cached__ `` attributes on module objects.
1260
1327
1261
- * Accessing ``co_lnotab `` was deprecated in :pep: `626 ` since 3.10
1262
- and was planned to be removed in 3.12
1263
- but it only got a proper :exc: `DeprecationWarning ` in 3.12.
1264
- May be removed in 3.14.
1265
- (Contributed by Nikita Sobolev in :gh: `101866 `.)
1328
+ * The ``co_lnotab `` attribute of code objects.
1266
1329
1267
1330
Pending Removal in Future Versions
1268
1331
----------------------------------
0 commit comments