Python 3.15 で削除予定

  • インポートシステム:

    • Setting __cached__ on a module while failing to set __spec__.cached is deprecated. In Python 3.15, __cached__ will cease to be set or take into consideration by the import system or standard library. (gh-97879)

    • モジュールの __spec__.parent を設定せずに __package__ を設定することは非推奨です。 Python 3.15 では、インポートシステムや標準ライブラリは __package__ を設定しなくなり、その値も参照しなくなります。 (gh-97879)

  • ctypes:

    • ドキュメント化されていない ctypes.SetPointerType() 関数は Python 3.13 から非推奨です。

  • http.server:

    • The obsolete and rarely used CGIHTTPRequestHandler has been deprecated since Python 3.13. No direct replacement exists. Anything is better than CGI to interface a web server with a request handler.

    • python -m http.server のコマンドラインインターフェースの --cgi フラグは Python 3.13 から非推奨です。

  • importlib:

    • load_module() メソッド:代わりに exec_module() を使ってください。

  • pathlib:

  • platform:

    • java_ver() has been deprecated since Python 3.13. This function is only useful for Jython support, has a confusing API, and is largely untested.

  • sysconfig:

  • threading:

    • RLock() は Python 3.15 から引数を受け取らなくなります。 Python 実装は引数を一切受け付けない一方、C 実装は任意の個数の位置引数やキーワード引数を受け付けてすべて無視するため、Python 3.14 から引数を渡すことは非推奨です。

  • types:

  • typing:

    • NamedTuple クラスを作成する、ドキュメント化されていないキーワード引数による構文 (例えば Point = NamedTuple("Point", x=int, y=int)) は Python 3.13 から非推奨です。 代わりにクラスベースの構文か関数形式の構文を使ってください。

    • TypedDict の関数形式の構文で、fields パラメータを省略すること (TD = TypedDict("TD")) や None を渡すこと (TD = TypedDict("TD", None)) は Python 3.13 から非推奨です。 フィールドがない TypedDict を作成するには、class TD(TypedDict): pass または TD = TypedDict("TD", {}) を使ってください。

    • The @typing.no_type_check_decorator decorator function has been deprecated since Python 3.13. After eight years in the typing module, it has yet to be supported by any major type checker.

  • wave:

  • zipimport: