در انتظار حذف در پایتون 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)تنظیم
__package__روی یک ماژول، بدون تنظیم__spec__.parent، منسوخ است. در پایتون 3.15،__package__دیگر توسط سیستم ایمپورت یا کتابخانه استاندارد تنظیم نخواهد شد و در نظر گرفته نخواهد شد. (gh-97879)
-
تابع مستندنشدهی
ctypes.SetPointerType()از پایتون 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.پرچم
--cgiدر رابط خط فرمان python -m http.server از پایتون 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.
-
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.
-
آرگومان check_home در
sysconfig.is_python_build()از پایتون 3.12 منسوخ شده است.
-
RLock()در پایتون 3.15 هیچ آرگومانی نخواهد پذیرفت. گذراندن هر آرگومانی از پایتون 3.14 منسوخ شده است، زیرا نسخهی پایتون اجازهی هیچ آرگومانی را نمیدهد، اما نسخهی C هر تعداد آرگومان جایگاهی یا کلیدواژهای را میپذیرد و همهی آرگومانها را نادیده میگیرد.
-
types.CodeType: Accessingcodeobject.co_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)) از پایتون 3.13 منسوخ شده است. به جای آن از سینتکس مبتنی بر کلاس یا سینتکس تابعی استفاده کنید.هنگام استفاده از سینتکس تابعی
TypedDicts، عدم گذر دادن مقدار به پارامتر fields (TD = TypedDict("TD")) یا گذر دادنNone(TD = TypedDict("TD", None)) از پایتون 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.
sre_compile,sre_constantsandsre_parsemodules.wave:The
getmark(),setmark()andgetmarkers()methods of theWave_readandWave_writeclasses have been deprecated since Python 3.13.
-
zipimport.zipimporter.load_module()has been deprecated since Python 3.10. Useexec_module()instead. (gh-125746.)