pending-removal-in-3.16.md
1> **Источник:** https://python-all.ru/3.16/deprecations/pending-removal-in-3.16.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# Запланировано к удалению в Python 3.1689- Система импорта:1011 - Установка [`__loader__`](https://python-all.ru/3.16/reference/datamodel.html#module.__loader__) в модуле при отсутствии [`__spec__.loader`](https://python-all.ru/3.16/library/importlib.html#importlib.machinery.ModuleSpec.loader) устарела. В Python 3.16 `__loader__` перестанет устанавливаться или учитываться системой импорта или стандартной библиотекой.12 - Установка [`__package__`](https://python-all.ru/3.16/reference/datamodel.html#module.__package__) в модуле при отсутствии [`__spec__.parent`](https://python-all.ru/3.16/library/importlib.html#importlib.machinery.ModuleSpec.parent) устарела. В Python 3.16 `__package__` перестанет устанавливаться или учитываться системой импорта или стандартной библиотекой. ([gh-97879](https://python-all.ru/3.16/deprecations/pending-removal-in-3.16.html))13- Встроенная копия `libmpdec`.14- [`array`](https://python-all.ru/3.16/library/array.html#module-array):1516 - Код формата `'u'` (`wchar_t`) устарел в документации начиная с Python 3.3 и во время выполнения начиная с Python 3.13. Используйте код формата `'w'` ([`Py_UCS4`](https://python-all.ru/3.16/c-api/unicode.html#c.Py_UCS4)) для символов Unicode.17- [`asyncio`](https://python-all.ru/3.16/library/asyncio.html#module-asyncio):1819 - `asyncio.iscoroutinefunction()` устарело и будет удалено в Python 3.16; используйте [`inspect.iscoroutinefunction()`](https://python-all.ru/3.16/library/inspect.html#inspect.iscoroutinefunction) вместо этого. (Предложено Jiahao Li и Kumar Aditya в [gh-122875](https://python-all.ru/3.16/deprecations/pending-removal-in-3.16.html).)20 - Система политик [`asyncio`](https://python-all.ru/3.16/library/asyncio.html#module-asyncio) устарела и будет удалена в Python 3.16. В частности, следующие классы и функции устарели:2122 - `asyncio.AbstractEventLoopPolicy`23 - `asyncio.DefaultEventLoopPolicy`24 - `asyncio.WindowsSelectorEventLoopPolicy`25 - `asyncio.WindowsProactorEventLoopPolicy`26 - `asyncio.get_event_loop_policy()`27 - `asyncio.set_event_loop_policy()`2829 Для использования нужной реализации цикла событий следует применять [`asyncio.run()`](https://python-all.ru/3.16/library/asyncio-runner.html#asyncio.run) или [`asyncio.Runner`](https://python-all.ru/3.16/library/asyncio-runner.html#asyncio.Runner) с параметром *loop\_factory*.3031 Например, чтобы использовать [`asyncio.SelectorEventLoop`](https://python-all.ru/3.16/library/asyncio-eventloop.html#asyncio.SelectorEventLoop) в Windows:3233 ```python34 import asyncio3536 async def main():37 ...3839 asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)40 ```4142 (Предложено Kumar Aditya в [gh-127949](https://python-all.ru/3.16/deprecations/pending-removal-in-3.16.html).)43- [`builtins`](https://python-all.ru/3.16/library/builtins.html#module-builtins):4445 - Поразрядная инверсия для булевых типов, `~True` или `~False` устарела начиная с Python 3.12, поскольку даёт неожиданные и неинтуитивные результаты (`-2` и `-1`). Используйте `not x` для логического отрицания булевого значения. В редких случаях, когда требуется поразрядная инверсия базового целого числа, явно преобразуйте в `int` (`~int(x)`).46- [`functools`](https://python-all.ru/3.16/library/functools.html#module-functools):4748 - Вызов реализации [`functools.reduce()`](https://python-all.ru/3.16/library/functools.html#functools.reduce) на Python с *function* или *sequence* в качестве именованных аргументов устарел начиная с Python 3.14.49- [`logging`](https://python-all.ru/3.16/library/logging.html#module-logging):5051 - Поддержка пользовательских обработчиков логирования с аргументом *strm* устарела и запланирована к удалению в Python 3.16. Вместо этого определяйте обработчики с аргументом *stream*. (Предложено Mariusz Felisiak в [gh-115032](https://python-all.ru/3.16/deprecations/pending-removal-in-3.16.html).)52- [`mimetypes`](https://python-all.ru/3.16/library/mimetypes.html#module-mimetypes):5354 - Допустимые расширения начинаются с точки ‘.’ или пусты для [`mimetypes.MimeTypes.add_type()`](https://python-all.ru/3.16/library/mimetypes.html#mimetypes.MimeTypes.add_type). Расширения без точки устарели и будут вызывать [`ValueError`](https://python-all.ru/3.16/library/exceptions.html#ValueError) в Python 3.16. (Предложено Hugo van Kemenade в [gh-75223](https://python-all.ru/3.16/deprecations/pending-removal-in-3.16.html).)55- [`shutil`](https://python-all.ru/3.16/library/shutil.html#module-shutil):5657 - Исключение `ExecError` устарело начиная с Python 3.14. Оно не используется ни одной функцией в `shutil` начиная с Python 3.4 и теперь является псевдонимом [`RuntimeError`](https://python-all.ru/3.16/library/exceptions.html#RuntimeError).58- [`symtable`](https://python-all.ru/3.16/library/symtable.html#module-symtable):5960 - Метод `symtable.Class.get_methods()` устарел начиная с Python 3.14.61- [`sys`](https://python-all.ru/3.16/library/sys.html#module-sys):6263 - Функция `_enablelegacywindowsfsencoding()` устарела начиная с Python 3.13. Используйте переменную окружения [`PYTHONLEGACYWINDOWSFSENCODING`](https://python-all.ru/3.16/using/cmdline.html#envvar-PYTHONLEGACYWINDOWSFSENCODING).64- [`sysconfig`](https://python-all.ru/3.16/library/sysconfig.html#module-sysconfig):6566 - Функция `sysconfig.expand_makefile_vars()` устарела начиная с Python 3.14. Используйте аргумент `vars` из [`sysconfig.get_paths()`](https://python-all.ru/3.16/library/sysconfig.html#sysconfig.get_paths).67- [`tarfile`](https://python-all.ru/3.16/library/tarfile.html#module-tarfile):6869 - Недокументированный и неиспользуемый атрибут `TarInfo.tarfile` устарел начиная с Python 3.13.70