در انتظار حذف در پایتون 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)

    • تنظیم __package__ روی یک ماژول، بدون تنظیم __spec__.parent، منسوخ است. در پایتون 3.15، __package__ دیگر توسط سیستم ایمپورت یا کتابخانه استاندارد تنظیم نخواهد شد و در نظر گرفته نخواهد شد. (gh-97879)

  • ctypes:

    • تابع مستندنشده‌ی ctypes.SetPointerType() از پایتون 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.

    • پرچم --cgi در رابط خط فرمان python -m http.server از پایتون 3.13 منسوخ شده است.

  • importlib:

    • متد load_module(): به‌جای آن از exec_module() استفاده کنید.

  • pathlib:

    • .PurePath.is_reserved() has been deprecated since Python 3.13. Use os.path.isreserved() to detect reserved paths on Windows.

  • platform:

    • 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() در پایتون 3.15 هیچ آرگومانی نخواهد پذیرفت. گذراندن هر آرگومانی از پایتون 3.14 منسوخ شده است، زیرا نسخه‌ی پایتون اجازه‌ی هیچ آرگومانی را نمی‌دهد، اما نسخه‌ی C هر تعداد آرگومان جایگاهی یا کلیدواژه‌ای را می‌پذیرد و همه‌ی آرگومان‌ها را نادیده می‌گیرد.

  • types:

    • types.CodeType: Accessing codeobject.co_lnotab was deprecated in PEP 626 since 3.10 and was planned to be removed in 3.12, but it only got a proper DeprecationWarning in 3.12. May be removed in 3.15. (Contributed by Nikita Sobolev in gh-101866.)

  • typing:

    • سینتکس مستندنشده‌ی آرگومان کلیدواژه‌ای برای ایجاد کلاس‌های 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_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.

  • sre_compile, sre_constants and sre_parse modules.

  • wave:

    • The getmark(), setmark() and getmarkers() methods of the Wave_read and Wave_write classes have been deprecated since Python 3.13.

  • zipimport:

    • zipimport.zipimporter.load_module() has been deprecated since Python 3.10. Use exec_module() instead. (gh-125746.)