sys

tempfile

time

tkinter

回溯

types

typing

unicodedata

venv

  • 增加了对在虚拟环境目录中添加源码控制管理 (SCM) 忽略文件的支持。 在默认情况下,Git 已受到支持。 此特性是以可被扩展为支持其他 SCM 的通过 API 选择启用 (EnvBuildercreate()),并通过 CLI 使用 --without-scm-ignore-files 选择禁用的方式实现的。 (由 Brett Cannon 在 gh-108125 [https://github.com/python/cpython/issues/108125] 中贡献。)

warnings

xml

(由 Sebastian Pipping 在 gh-115623 [https://github.com/python/cpython/issues/115623] 中贡献。)

zipimport

性能优化

被移除的模块与 API

PEP 594: 从标准库中移除“死电池”

PEP 594 [https://peps.python.org/pep-0594/] 提议从标准库移除 19 个模块,它们因其古旧、过时或不安全的状态而被非正式地称呼为‘死电池’。 下列所有模块在 Python 3.11 中被弃用,现在已被移除:

  1. from email.message import EmailMessage
  2.  
  3. msg = EmailMessage()
  4. msg['content-type'] = 'application/json; charset="utf8"'
  5. main, params = msg.get_content_type(), msg['content-type'].params
  • uu: 改用 the base64 模块,作为一款现代化的替代。
  • xdrlib

(由 Victor Stinner 和 Zachary Ware 在 gh-104773 [https://github.com/python/cpython/issues/104773] 和 gh-104780 [https://github.com/python/cpython/issues/104780] 中贡献。)

2to3

builtins

configparser

importlib.metadata

locale

opcode

  • opcode.ENABLE_SPECIALIZATION 移至 opcode.ENABLESPECIALIZATION。 这个字段在是 3.12 中增加的,它从未被写入文档,也无意开放给外部使用。 (由 Irit Katriel 在 gh-105481 [https://github.com/python/cpython/issues/105481] 中贡献。)

  • 移除了 opcode.is_pseudo(), opcode.MIN_PSEUDO_OPCODEopcode.MAX_PSEUDO_OPCODE,它们是在 Python 3.12 中增加了,但从未被写入文档也未通过 dis 对外公开,并且不应当在外部被使用。 (由 Irit Katriel 在 gh-105481 [https://github.com/python/cpython/issues/105481] 中贡献。)

optparse

  • This module is no longer considered soft deprecated. While argparse remains preferred for new projects that aren't using a third party command line argument processing library, there are aspects of the way argparse works that mean the lower level optparse module may provide a better foundation for writing argument processing libraries, and for implementing command line applications which adhere more strictly than argparse does to various Unix command line processing conventions that originate in the behaviour of the C getopt() function . (Contributed by Alyssa Coghlan and Serhiy Storchaka in gh-126180 [https://github.com/python/cpython/issues/126180].)

pathlib

re

tkinter.tix

turtle