Python 3.15 で削除予定¶
インポートシステム:
Setting
__cached__on a module while failing to set__spec__.cachedis 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.SetPointerType()関数は Python 3.13 から非推奨です。
-
The obsolete and rarely used
CGIHTTPRequestHandlerhas 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 から非推奨です。
-
load_module()メソッド:代わりにexec_module()を使ってください。
-
PurePath.is_reserved()has been deprecated since Python 3.13. Useos.path.isreserved()to detect reserved paths on Windows.
-
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.is_python_build()のcheck_home引数は Python 3.12 から非推奨です。
-
RLock()は Python 3.15 から引数を受け取らなくなります。 Python 実装は引数を一切受け付けない一方、C 実装は任意の個数の位置引数やキーワード引数を受け付けてすべて無視するため、Python 3.14 から引数を渡すことは非推奨です。
-
types.CodeType: Accessingco_lnotabwas deprecated in PEP 626 since 3.10 and was planned to be removed in 3.12, but it only got a properDeprecationWarningin 3.12. May be removed in 3.15. (Contributed by Nikita Sobolev in gh-101866.)
-
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_decoratordecorator function has been deprecated since Python 3.13. After eight years in thetypingmodule, it has yet to be supported by any major type checker.
wave:The
getmark(),setmark(), andgetmarkers()methods of theWave_readandWave_writeclasses have been deprecated since Python 3.13.
-
load_module()has been deprecated since Python 3.10. Useexec_module()instead. (Contributed by Jiahao Li in gh-125746.)