> **Источник:** https://python-all.ru/3.14/deprecations/pending-removal-in-3.16.html
>
> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.

---

# Запланировано к удалению в Python 3.16

- Система импорта:

  - Установка [`__loader__`](https://python-all.ru/3.14/reference/datamodel.html#module.__loader__) в модуле при отсутствии [`__spec__.loader`](https://python-all.ru/3.14/library/importlib.html#importlib.machinery.ModuleSpec.loader) устарела. В Python 3.16 `__loader__` перестанет устанавливаться или учитываться системой импорта или стандартной библиотекой.
- [`array`](https://python-all.ru/3.14/library/array.html#module-array):

  - Код формата `'u'` (`wchar_t`) устарел в документации начиная с Python 3.3 и во время выполнения начиная с Python 3.13. Используйте код формата `'w'` ([`Py_UCS4`](https://python-all.ru/3.14/c-api/unicode.html#c.Py_UCS4)) для символов Unicode.
- [`asyncio`](https://python-all.ru/3.14/library/asyncio.html#module-asyncio):

  - `asyncio.iscoroutinefunction()` устарело и будет удалено в Python 3.16; используйте [`inspect.iscoroutinefunction()`](https://python-all.ru/3.14/library/inspect.html#inspect.iscoroutinefunction) вместо этого. (Предложено Jiahao Li и Kumar Aditya в [gh-122875](https://python-all.ru/3.14/deprecations/pending-removal-in-3.16.html).)
  - Система политик [`asyncio`](https://python-all.ru/3.14/library/asyncio.html#module-asyncio) устарела и будет удалена в Python 3.16. В частности, следующие классы и функции устарели:

    - [`asyncio.AbstractEventLoopPolicy`](https://python-all.ru/3.14/library/asyncio-policy.html#asyncio.AbstractEventLoopPolicy)
    - [`asyncio.DefaultEventLoopPolicy`](https://python-all.ru/3.14/library/asyncio-policy.html#asyncio.DefaultEventLoopPolicy)
    - [`asyncio.WindowsSelectorEventLoopPolicy`](https://python-all.ru/3.14/library/asyncio-policy.html#asyncio.WindowsSelectorEventLoopPolicy)
    - [`asyncio.WindowsProactorEventLoopPolicy`](https://python-all.ru/3.14/library/asyncio-policy.html#asyncio.WindowsProactorEventLoopPolicy)
    - [`asyncio.get_event_loop_policy()`](https://python-all.ru/3.14/library/asyncio-policy.html#asyncio.get_event_loop_policy)
    - [`asyncio.set_event_loop_policy()`](https://python-all.ru/3.14/library/asyncio-policy.html#asyncio.set_event_loop_policy)

    Для использования нужной реализации цикла событий следует применять [`asyncio.run()`](https://python-all.ru/3.14/library/asyncio-runner.html#asyncio.run) или [`asyncio.Runner`](https://python-all.ru/3.14/library/asyncio-runner.html#asyncio.Runner) с параметром *loop\_factory*.

    Например, чтобы использовать [`asyncio.SelectorEventLoop`](https://python-all.ru/3.14/library/asyncio-eventloop.html#asyncio.SelectorEventLoop) в Windows:

    ```python
    import asyncio

    async def main():
        ...

    asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)
    ```

    (Предложено Kumar Aditya в [gh-127949](https://python-all.ru/3.14/deprecations/pending-removal-in-3.16.html).)
- [`builtins`](https://python-all.ru/3.14/library/builtins.html#module-builtins):

  - Поразрядная инверсия для булевых типов, `~True` или `~False` устарела начиная с Python 3.12, поскольку даёт неожиданные и неинтуитивные результаты (`-2` и `-1`). Используйте `not x` для логического отрицания булевого значения. В редких случаях, когда требуется поразрядная инверсия базового целого числа, явно преобразуйте в `int` (`~int(x)`).
- [`functools`](https://python-all.ru/3.14/library/functools.html#module-functools):

  - Вызов реализации [`functools.reduce()`](https://python-all.ru/3.14/library/functools.html#functools.reduce) на Python с *function* или *sequence* в качестве именованных аргументов устарел начиная с Python 3.14.
- [`logging`](https://python-all.ru/3.14/library/logging.html#module-logging):

  Поддержка пользовательских обработчиков логирования с аргументом *strm* устарела и запланирована к удалению в Python 3.16. Вместо этого определяйте обработчики с аргументом *stream*. (Предложено Mariusz Felisiak в [gh-115032](https://python-all.ru/3.14/deprecations/pending-removal-in-3.16.html).)
- [`mimetypes`](https://python-all.ru/3.14/library/mimetypes.html#module-mimetypes):

  - Допустимые расширения начинаются с точки ‘.’ или пусты для [`mimetypes.MimeTypes.add_type()`](https://python-all.ru/3.14/library/mimetypes.html#mimetypes.MimeTypes.add_type). Расширения без точки устарели и будут вызывать [`ValueError`](https://python-all.ru/3.14/library/exceptions.html#ValueError) в Python 3.16. (Предложено Hugo van Kemenade в [gh-75223](https://python-all.ru/3.14/deprecations/pending-removal-in-3.16.html).)
- [`shutil`](https://python-all.ru/3.14/library/shutil.html#module-shutil):

  - Исключение `ExecError` устарело начиная с Python 3.14. Оно не используется ни одной функцией в `shutil` начиная с Python 3.4 и теперь является псевдонимом [`RuntimeError`](https://python-all.ru/3.14/library/exceptions.html#RuntimeError).
- [`symtable`](https://python-all.ru/3.14/library/symtable.html#module-symtable):

  - Метод [`Class.get_methods`](https://python-all.ru/3.14/library/symtable.html#symtable.Class.get_methods) устарел начиная с Python 3.14.
- [`sys`](https://python-all.ru/3.14/library/sys.html#module-sys):

  - Функция [`_enablelegacywindowsfsencoding()`](https://python-all.ru/3.14/library/sys.html#sys._enablelegacywindowsfsencoding) устарела начиная с Python 3.13. Используйте переменную окружения [`PYTHONLEGACYWINDOWSFSENCODING`](https://python-all.ru/3.14/using/cmdline.html#envvar-PYTHONLEGACYWINDOWSFSENCODING).
- [`sysconfig`](https://python-all.ru/3.14/library/sysconfig.html#module-sysconfig):

  - Функция `sysconfig.expand_makefile_vars()` устарела начиная с Python 3.14. Используйте аргумент `vars` из [`sysconfig.get_paths()`](https://python-all.ru/3.14/library/sysconfig.html#sysconfig.get_paths).
- [`tarfile`](https://python-all.ru/3.14/library/tarfile.html#module-tarfile):

  - Недокументированный и неиспользуемый атрибут `TarFile.tarfile` устарел начиная с Python 3.13.
