計劃在 Python 3.16 中移除

  • 匯入系統

    • 在模組上設定 __loader__ 而不設定 __spec__.loader 已被棄用。在 Python 3.16 中,匯入系統或標準庫將不再設定或考慮 __loader__

  • array:

    • 自 Python 3.3 起,文件中已棄用 'u' 格式程式碼(wchar_t),自 Python 3.13 起在執行時已棄用。請改用 'w' 格式程式碼(Py_UCS4)表示 Unicode 字元。

  • asyncio:

  • builtins:

    • 自 Python 3.12 起,布林型別上的按位取反 ~True~False 已被棄用,因為它會產生令人驚訝且不直觀的結果(-2-1)。請改用 not x 來表示布林值的邏輯否定。在極少數情況下,您需要底層整數的按位取反,請顯式轉換為 int~int(x))。

  • shutil:

    • 自 Python 3.14 起,ExecError 異常已被棄用。shutil 中的任何函式自 Python 3.4 起都未使用它,現在它是 RuntimeError 的別名。

  • symtable:

  • sys:

  • tarfile:

    • 自 Python 3.13 起,未記錄且未使用的 TarFile.tarfile 屬性已被棄用。