Pelokalan
Python ID
id en
Masuk
Proyek
whatsnew__3-12.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
Python 3.12 is a stable release of the Python programming language, with a mix of changes to the language and the standard library. The library changes focus on cleaning up deprecated APIs, usability, and correctness. Of note, the :mod:`!distutils` package has been removed from the standard library. Filesystem support in :mod:`os` and :mod:`pathlib` has seen a number of improvements, and several modules have better performance.
:pep:`632`: Remove the :mod:`!distutils` package. See :pep:`the migration guide <0632#migration-advice>` for advice replacing the APIs it provided. The third-party `Setuptools <https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html>`__ package continues to provide :mod:`!distutils`, if you still require it in Python 3.12 and beyond.
Octal escapes with value larger than ``0o377`` (ex: ``"\477"``), deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. In a future Python version they will be eventually a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)
:func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The ``st_birthtime`` field will now be filled with the creation time of the file, and ``st_ctime`` is deprecated but still contains the creation time (but in the future will return the last metadata change, for consistency with other platforms). ``st_dev`` may be up to 64 bits and ``st_ino`` up to 128 bits depending on your file system, and ``st_rdev`` is always set to zero rather than incorrect values. Both functions may be significantly faster on newer releases of Windows. (Contributed by Steve Dower in :gh:`99726`.)
:func:`shutil.rmtree` now accepts a new argument *onexc* which is an error handler like *onerror* but which expects an exception instance rather than a *(typ, val, tb)* triplet. *onerror* is deprecated. (Contributed by Irit Katriel in :gh:`102828`.)
Deprecated
Usang
:mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. (Contributed by Nikita Sobolev in :gh:`92248`.)
:mod:`ast`: The following :mod:`ast` features have been deprecated in documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at runtime when they are accessed or used, and will be removed in Python 3.14:
The child watcher classes :class:`!asyncio.MultiLoopChildWatcher`, :class:`!asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` and :class:`!asyncio.SafeChildWatcher` are deprecated and will be removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)
:func:`!asyncio.set_child_watcher`, :func:`!asyncio.get_child_watcher`, :meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)
:mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)
:mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`.
:mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime.utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and will be removed in a future version. Instead, use timezone-aware objects to represent datetimes in UTC: respectively, call :meth:`~datetime.datetime.now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)
:mod:`importlib.abc`: Deprecated the following classes, scheduled for removal in Python 3.14:
:mod:`pkgutil`: :func:`!pkgutil.find_loader` and :func:`!pkgutil.get_loader` are deprecated and will be removed in Python 3.14; use :func:`importlib.util.find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)
:mod:`pty`: The module has two undocumented ``master_open()`` and ``slave_open()`` functions that have been deprecated since Python 2 but only gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14. (Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)
The ``st_ctime`` fields return by :func:`os.stat` and :func:`os.lstat` on Windows are deprecated. In a future release, they will contain the last metadata change time, consistent with other platforms. For now, they still contain the creation time, which is also available in the new ``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)
:mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated; use *onexc* instead. (Contributed by Irit Katriel in :gh:`102828`.)
:ref:`default adapters and converters <sqlite3-default-converters>` are now deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)
:mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys.last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. (Contributed by Irit Katriel in :gh:`102778`.)
:mod:`tarfile`: Extracting tar archives without specifying *filter* is deprecated until Python 3.14, when ``'data'`` filter will become the default. See :ref:`tarfile-extraction-filter` for details.
:class:`typing.Hashable` and :class:`typing.Sized`, aliases for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized` respectively, are deprecated. (:gh:`94309`.)
:class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:`DeprecationWarning` to be emitted when it is used. (Contributed by Alex Waygood in :gh:`91896`.)
The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() <coroutine.throw>`, :meth:`generator throw() <generator.throw>` and :meth:`async generator throw() <agen.athrow>` are deprecated and may be removed in a future version of Python. Use the single-arg versions of these functions instead. (Contributed by Ofey Chan in :gh:`89874`.)
Setting :attr:`~module.__package__` or ``__cached__`` on a module is deprecated, and will cease to be set or taken into consideration by the import system in Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)
The bitwise inversion operator (``~``) on bool is deprecated. It will throw an error in Python 3.16. Use ``not`` for logical negation of bools instead. In the rare case that you really need the bitwise inversion of the underlying ``int``, convert to int explicitly: ``~int(x)``. (Contributed by Tim Hoffmann in :gh:`103487`.)
Accessing :attr:`!codeobject.co_lnotab` on code objects was deprecated in Python 3.10 via :pep:`626`, but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)
:mod:`ast`: The following features have been deprecated in documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at runtime when they are accessed or used, and will be removed in Python 3.14:
:mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils.localtime`. (Contributed by Alan Williams in :gh:`72346`.)
:mod:`importlib.abc` deprecated classes:
:mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is deprecated.
:mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not intended to be a public API. (Contributed by Gregory P. Smith in :gh:`88168`.)
Setting ``__cached__`` on a module while failing to set :attr:`__spec__.cached <importlib.machinery.ModuleSpec.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`)
Setting :attr:`~module.__package__` on a module while failing to set :attr:`__spec__.parent <importlib.machinery.ModuleSpec.parent>` is deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or take into consideration by the import system or standard library. (:gh:`97879`)
The undocumented :func:`!ctypes.SetPointerType` function has been deprecated since Python 3.13.
The obsolete and rarely used :class:`!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.
The :option:`!--cgi` flag to the :program:`python -m http.server` command-line interface has been deprecated since Python 3.13.
:meth:`!.PurePath.is_reserved` has been deprecated since Python 3.13. Use :func:`os.path.isreserved` to detect reserved paths on Windows.
:func:`!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.
The *check_home* argument of :func:`sysconfig.is_python_build` has been deprecated since Python 3.12.
:func:`~threading.RLock` will take no arguments in Python 3.15. Passing any arguments has been deprecated since Python 3.14, as the Python version does not permit any arguments, but the C version allows any number of positional or keyword arguments, ignoring every argument.
:class:`types.CodeType`: Accessing :attr:`!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 :exc:`DeprecationWarning` in 3.12. May be removed in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)
The undocumented keyword argument syntax for creating :class:`~typing.NamedTuple` classes (for example, ``Point = NamedTuple("Point", x=int, y=int)``) has been deprecated since Python 3.13. Use the class-based syntax or the functional syntax instead.
When using the functional syntax of :class:`~typing.TypedDict`\s, failing to pass a value to the *fields* parameter (``TD = TypedDict("TD")``) or passing ``None`` (``TD = TypedDict("TD", None)``) has been deprecated since Python 3.13. Use ``class TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})`` to create a TypedDict with zero field.
The :deco:`!typing.no_type_check_decorator` decorator function has been deprecated since Python 3.13. After eight years in the :mod:`typing` module, it has yet to be supported by any major type checker.
The ``getmark()``, ``setmark()`` and ``getmarkers()`` methods of the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been deprecated since Python 3.13.
:meth:`!zipimport.zipimporter.load_module` has been deprecated since Python 3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (:gh:`125746`.)
Setting :attr:`~module.__loader__` on a module while failing to set :attr:`__spec__.loader <importlib.machinery.ModuleSpec.loader>` is deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or taken into consideration by the import system or the standard library.
The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in documentation since Python 3.3 and at runtime since Python 3.13. Use the ``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead.
:func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in Python 3.16; use :func:`inspect.iscoroutinefunction` instead. (Contributed by Jiahao Li and Kumar Aditya in :gh:`122875`.)
:mod:`asyncio` policy system is deprecated and will be removed in Python 3.16. In particular, the following classes and functions are deprecated:
Bitwise inversion on boolean types, ``~True`` or ``~False`` has been deprecated since Python 3.12, as it produces surprising and unintuitive results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation of a Boolean. In the rare case that you need the bitwise inversion of the underlying integer, convert to ``int`` explicitly (``~int(x)``).
Calling the Python implementation of :func:`functools.reduce` with *function* or *sequence* as keyword arguments has been deprecated since Python 3.14.
Support for custom logging handlers with the *strm* argument is deprecated and scheduled for removal in Python 3.16. Define handlers with the *stream* argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)
Valid extensions start with a '.' or are empty for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:`75223`.)
The :class:`!ExecError` exception has been deprecated since Python 3.14. It has not been used by any function in :mod:`!shutil` since Python 3.4, and is now an alias of :exc:`RuntimeError`.
The :meth:`Class.get_methods <symtable.Class.get_methods>` method has been deprecated since Python 3.14.
The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment variable instead.
The :func:`!sysconfig.expand_makefile_vars` function has been deprecated since Python 3.14. Use the ``vars`` argument of :func:`sysconfig.get_paths` instead.
The undocumented and unused :attr:`!TarFile.tarfile` attribute has been deprecated since Python 3.13.
:meth:`~datetime.datetime.strptime` calls using a format string containing ``%e`` (day of month) without a year. This has been deprecated since Python 3.15. (Contributed by Stan Ulbrych in :gh:`70647`.)
Passing non-ascii *encoding* names to :func:`encodings.normalize_encoding` is deprecated and scheduled for removal in Python 3.17. (Contributed by Stan Ulbrych in :gh:`136702`.)
The :mod:`!profile` module is deprecated and will be removed in Python 3.17. Use :mod:`profiling.tracing` instead, which provides a compatible API. See :pep:`799` for details. (Contributed by Pablo Galindo and László Kiss Kollár in :gh:`138122`.)
:class:`!webbrowser.MacOSXOSAScript` is deprecated in favour of :class:`!webbrowser.MacOS`. (:gh:`137586`)
:class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for removal in Python 3.17.
The :class:`!tkinter.Variable` methods :meth:`!trace_variable`, :meth:`!trace` (an alias of :meth:`!trace_variable`), :meth:`!trace_vdelete` and :meth:`!trace_vinfo`, deprecated since Python 3.14, are scheduled for removal in Python 3.17. Use :meth:`!trace_add`, :meth:`!trace_remove` and :meth:`!trace_info` instead. (Contributed by Serhiy Storchaka in :gh:`120220`.)
Support for the ``string`` keyword argument name is now deprecated and slated for removal in Python 3.19.
:meth:`http.cookies.Morsel.js_output` is deprecated and will be removed in Python 3.19.
:meth:`http.cookies.BaseCookie.js_output` is deprecated and will be removed in Python 3.19.
Altering :attr:`IMAP4.file <imaplib.IMAP4.file>` is now deprecated and slated for removal in Python 3.19. This property is now unused and changing its value does not automatically close the current file.
Calling the ``__new__()`` method of :class:`struct.Struct` without the *format* argument is deprecated and will be removed in Python 3.20. Calling :meth:`~object.__init__` method on initialized :class:`~struct.Struct` objects is deprecated and will be removed in Python 3.20.
The ``__version__``, ``version`` and ``VERSION`` attributes have been deprecated in these standard library modules and will be removed in Python 3.20. Use :py:data:`sys.version_info` instead.
:mod:`logging` (``__date__`` also deprecated)
Creating instances of abstract AST nodes (such as :class:`ast.AST` or :class:`!ast.expr`) is deprecated and will raise an error in Python 3.20.
It is deprecated to call :func:`isinstance` and :func:`issubclass` checks on protocol classes that were not explicitly decorated with :func:`!runtime_checkable` but that inherit from a runtime-checkable protocol class. This will raise a :exc:`TypeError` in Python 3.20.
Nesting argument groups and nesting mutually exclusive groups are deprecated.
Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated.
The :class:`argparse.FileType` type converter is deprecated.
Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single argument signature.
Passing a complex number as the *real* or *imag* argument in the :func:`complex` constructor is now deprecated; it should only be passed as a single positional argument. (Contributed by Serhiy Storchaka in :gh:`109218`.)
:func:`~importlib.util.cache_from_source` *debug_override* parameter is deprecated: use the *optimization* parameter instead.
:mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, use :meth:`~logging.warning` instead.
:mod:`mailbox`: Use of StringIO input and text mode is deprecated, use BytesIO and binary mode instead.
:mod:`os.path`: :func:`os.path.commonprefix` is deprecated, use :func:`os.path.commonpath` for path prefixes. The :func:`os.path.commonprefix` function is being deprecated due to having a misleading name and module. The function is not safe to use for path prefixes despite being included in a module about path manipulation, meaning it is easy to accidentally introduce path traversal vulnerabilities into Python programs by using this function.
:class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is deprecated, use an exception instance.
:mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in Python 3.12; use the *onexc* parameter instead.
:class:`ssl.SSLContext` without protocol argument is deprecated.
:class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead.
:class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a value that is not ``None`` from a test case.
:mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` instead
:mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future release it will always return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests instead.
:func:`sys._clear_type_cache` is deprecated: use :func:`sys._clear_internal_caches` instead.
These two modules have been removed according to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)
Several names deprecated in the :mod:`configparser` way back in 3.2 have been removed per :gh:`89336`:
Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 by :pep:`632` "Deprecate distutils module". For projects still using ``distutils`` and cannot be updated to something else, the ``setuptools`` project can be installed: it still provides ``distutils``. (Contributed by Victor Stinner in :gh:`92584`.)
Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute instead. In write mode, the ``filename`` attribute added ``'.gz'`` file extension if it was not present. (Contributed by Victor Stinner in :gh:`94196`.)
Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib.pbkdf2_hmac`, deprecated in Python 3.10. Python 3.10 and newer requires OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation of :func:`~hashlib.pbkdf2_hmac` which is faster. (Contributed by Victor Stinner in :gh:`94199`.)
Many previously deprecated cleanups in :mod:`importlib` have now been completed:
Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io.open`) function is a built-in function. Since Python 3.10, :func:`!_pyio.open` is also a static method. (Contributed by Victor Stinner in :gh:`94169`.)
Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor Stinner in :gh:`94226`.)
The ``smtpd`` module has been removed according to the schedule in :pep:`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use the :pypi:`aiosmtpd` PyPI module or any other :mod:`asyncio`-based server instead. (Contributed by Oleg Iarygin in :gh:`93243`.)
The following undocumented :mod:`sqlite3` features, deprecated in Python 3.10, are now removed:
Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed by Victor Stinner in :gh:`94199`.)
Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python 3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer uses the :func:`!ssl.match_hostname` function. (Contributed by Victor Stinner in :gh:`94199`.)
Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl.SSLContext.wrap_socket` method. Any package that still uses :func:`!ssl.wrap_socket` is broken and insecure. The function neither sends a SNI TLS extension nor validates the server hostname. Code is subject to :cwe:`295` (Improper Certificate Validation). (Contributed by Victor Stinner in :gh:`94199`.)
Remove many long-deprecated :mod:`unittest` features:
Deprecated alias
Deprecated in
Undocumented and broken :class:`~unittest.TestCase` method ``assertDictContainsSubset`` (deprecated in Python 3.2).
Undocumented :meth:`TestLoader.loadTestsFromModule <unittest.TestLoader.loadTestsFromModule>` parameter *use_load_tests* (deprecated and ignored since Python 3.5).
An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` (deprecated in Python 3.2).
Remove the ``ElementTree.Element.copy()`` method of the pure Python implementation, deprecated in Python 3.10, use the :func:`copy.copy` function instead. The C implementation of :mod:`xml.etree.ElementTree` has no ``copy()`` method, only a ``__copy__()`` method. (Contributed by Victor Stinner in :gh:`94383`.)
Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)
Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, *cert_file* and *check_hostname* parameters from the :mod:`http.client` module, all deprecated since Python 3.6. Use the *context* parameter (*ssl_context* in :mod:`imaplib`) instead. (Contributed by Victor Stinner in :gh:`94172`.)
Remove ``randrange()`` functionality deprecated since Python 3.10. Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. Now, it raises a :exc:`TypeError`. Also, the exception raised for non-integer values such as ``randrange(10.5)`` or ``randrange('10')`` has been changed from :exc:`ValueError` to :exc:`TypeError`. This also prevents bugs where ``randrange(1e25)`` would silently select from a larger range than ``randrange(10**25)``. (Originally suggested by Serhiy Storchaka :gh:`86388`.)
Remove the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 and 3.5.4. A recommended replacement is the :mod:`asyncio`-based :pypi:`aiosmtpd` PyPI module.
:func:`shlex.split`: Passing ``None`` for *s* argument now raises an exception, rather than reading :data:`sys.stdin`. The feature was deprecated in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)
Add :c:func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` for saving and restoring the current exception. These functions return and accept a single exception object, rather than the triple arguments of the now-deprecated :c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore`. This is less error prone and a bit more efficient. (Contributed by Mark Shannon in :gh:`101578`.)
Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. (Contributed by Mark Shannon in :gh:`101578`.)
Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` is deprecated, and in Python 3.14+ it will be disallowed. Note that these functions ignore ``tp_new`` of the metaclass, possibly allowing incomplete initialization.
In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:`PyDictObject` is deprecated for extension modules. Accessing this field will generate a compiler warning at compile time. This field will be removed in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. PEP by Ken Jin.)
Creating :c:data:`immutable types <Py_TPFLAGS_IMMUTABLETYPE>` with mutable bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)
The :file:`structmember.h` header is deprecated, though it continues to be available and there are no plans to remove it.
The deprecated header continues to provide its original contents under the original names. Your old code can stay unchanged, unless the extra include and non-namespaced macros bother you greatly.
:c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` instead. (Contributed by Mark Shannon in :gh:`101578`.)
:c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` instead. (Contributed by Irit Katriel in :gh:`102755`).
``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` instead. (Contributed by Irit Katriel in :gh:`102192`.)
Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead.
Python initialization functions, deprecated in Python 3.13:
Functions to configure Python's initialization, deprecated in Python 3.11:
The following APIs are deprecated and will be removed, although there is currently no date scheduled for their removal.