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

---

# Ожидается удаление в Python 3.20

- Вызов метода `__new__()` объекта [`struct.Struct`](https://python-all.ru/3.15/library/struct.html#struct.Struct) без аргумента *format* устарел и будет удалён в Python 3.20. Вызов [`__init__()`](https://python-all.ru/3.15/reference/datamodel.html#object.__init__) метода для инициализированных объектов `Struct` устарел и будет удалён в Python 3.20.

  (Вклад: Sergey B Kirpichev и Serhiy Storchaka в [gh-143715](https://python-all.ru/3.15/deprecations/pending-removal-in-3.20.html).)
- Атрибуты `__version__`, `version` и `VERSION` были объявлены устаревшими в этих модулях стандартной библиотеки и будут удалены в Python 3.20. Вместо них используйте [`sys.version_info`](https://python-all.ru/3.15/library/sys.html#sys.version_info).

  - [`argparse`](https://python-all.ru/3.15/library/argparse.html#module-argparse)
  - [`csv`](https://python-all.ru/3.15/library/csv.html#module-csv)
  - [`ctypes`](https://python-all.ru/3.15/library/ctypes.html#module-ctypes)
  - `ctypes.macholib`
  - [`decimal`](https://python-all.ru/3.15/library/decimal.html#module-decimal) (используйте [`decimal.SPEC_VERSION`](https://python-all.ru/3.15/library/decimal.html#decimal.SPEC_VERSION) вместо)
  - [`http.server`](https://python-all.ru/3.15/library/http.server.html#module-http.server)
  - [`imaplib`](https://python-all.ru/3.15/library/imaplib.html#module-imaplib)
  - [`ipaddress`](https://python-all.ru/3.15/library/ipaddress.html#module-ipaddress)
  - [`json`](https://python-all.ru/3.15/library/json.html#module-json)
  - [`logging`](https://python-all.ru/3.15/library/logging.html#module-logging) (`__date__` также устарел)
  - [`optparse`](https://python-all.ru/3.15/library/optparse.html#module-optparse)
  - [`pickle`](https://python-all.ru/3.15/library/pickle.html#module-pickle)
  - [`platform`](https://python-all.ru/3.15/library/platform.html#module-platform)
  - [`re`](https://python-all.ru/3.15/library/re.html#module-re)
  - [`socketserver`](https://python-all.ru/3.15/library/socketserver.html#module-socketserver)
  - [`tabnanny`](https://python-all.ru/3.15/library/tabnanny.html#module-tabnanny)
  - [`tarfile`](https://python-all.ru/3.15/library/tarfile.html#module-tarfile)
  - [`tkinter.font`](https://python-all.ru/3.15/library/tkinter.font.html#module-tkinter.font)
  - [`tkinter.ttk`](https://python-all.ru/3.15/library/tkinter.ttk.html#module-tkinter.ttk)
  - [`wsgiref.simple_server`](https://python-all.ru/3.15/library/wsgiref.html#module-wsgiref.simple_server)
  - [`xml.etree.ElementTree`](https://python-all.ru/3.15/library/xml.etree.elementtree.html#module-xml.etree.ElementTree)
  - `xml.sax.expatreader`
  - [`xml.sax.handler`](https://python-all.ru/3.15/library/xml.sax.handler.html#module-xml.sax.handler)
  - [`zlib`](https://python-all.ru/3.15/library/zlib.html#module-zlib)

  (Вклад: Hugo van Kemenade и Stan Ulbrych в [gh-76007](https://python-all.ru/3.15/deprecations/pending-removal-in-3.20.html).)
- Устаревшие элементы, определённые [**PEP 829**](https://python-all.ru/3.15/deprecations/pending-removal-in-3.20.html):

  - Предупреждения выводятся для строк `import`, найденных в `name.pth` файлах.
  - Файлы `name.pth` больше не декодируются в кодировке локали по умолчанию. Они **ДОЛЖНЫ** быть закодированы в `utf-8-sig`.

  (Вклад: Barry Warsaw в [gh-148641](https://python-all.ru/3.15/deprecations/pending-removal-in-3.20.html).)
- [`ast`](https://python-all.ru/3.15/library/ast.html#module-ast):

  - Создание экземпляров абстрактных узлов AST (таких как [`ast.AST`](https://python-all.ru/3.15/library/ast.html#ast.AST) или `ast.expr`) устарело и будет вызывать ошибку в Python 3.20.
