Pelokalan
Python ID
id en
Masuk
Proyek
whatsnew__3-10.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
The :attr:`!codeobject.co_lnotab` attribute of :ref:`code objects <code-objects>` is deprecated and will be removed in 3.12. Code that needs to convert from offset to line number should use the new :meth:`~codeobject.co_lines` method instead.
These modules have been marked as deprecated in their module documentation since Python 3.6. An import-time :class:`DeprecationWarning` has now been added to all three of these modules.
The entire ``distutils`` package is deprecated, to be removed in Python 3.12. Its functionality for specifying package builds has already been completely replaced by third-party packages ``setuptools`` and ``packaging``, and most other commonly used APIs are available elsewhere in the standard library (such as :mod:`platform`, :mod:`shutil`, :mod:`subprocess` or :mod:`sysconfig`). There are no plans to migrate any other functionality from ``distutils``, and applications that are using other functions should plan to make private copies of the code. Refer to :pep:`632` for discussion.
The ``bdist_wininst`` command deprecated in Python 3.8 has been removed. The ``bdist_wheel`` command is now recommended to distribute binary packages on Windows. (Contributed by Victor Stinner in :issue:`42802`.)
The pure-Python fallback of :func:`~hashlib.pbkdf2_hmac` is deprecated. In the future PBKDF2-HMAC will only be available when Python has been built with OpenSSL support. (Contributed by Christian Heimes in :issue:`43880`.)
Deprecated function and use of deprecated constants now result in a :exc:`DeprecationWarning`. :attr:`ssl.SSLContext.options` has :data:`~ssl.OP_NO_SSLv2` and :data:`~ssl.OP_NO_SSLv3` set by default and therefore cannot warn about setting the flag again. The :ref:`deprecation section <whatsnew310-deprecated>` has a list of deprecated features. (Contributed by Christian Heimes in :issue:`43880`.)
The deprecated protocols SSL 3.0, TLS 1.0, and TLS 1.1 are no longer officially supported. Python does not block them actively. However OpenSSL build options, distro configurations, vendor patches, and cipher suites may prevent a successful handshake.
Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :exc:`DeprecationWarning`. These submodules have been deprecated since Python 3.8 and will be removed in a future version of Python. Anything belonging to those submodules should be imported directly from :mod:`typing` instead. (Contributed by Sebastian Rittau in :issue:`38291`.)
Deprecated
Usang
The entire ``distutils`` namespace is deprecated, to be removed in Python 3.12. Refer to the :ref:`module changes <distutils-deprecated>` section for more information.
Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by Serhiy Storchaka and Raymond Hettinger in :issue:`37319`.)
The various ``load_module()`` methods of :mod:`importlib` have been documented as deprecated since Python 3.6, but will now also trigger a :exc:`DeprecationWarning`. Use :meth:`~importlib.abc.Loader.exec_module` instead. (Contributed by Brett Cannon in :issue:`26131`.)
:meth:`!zipimport.zipimporter.load_module` has been deprecated in preference for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon in :issue:`26131`.)
The various implementations of :meth:`!importlib.abc.MetaPathFinder.find_module` ( :meth:`!importlib.machinery.BuiltinImporter.find_module`, :meth:`!importlib.machinery.FrozenImporter.find_module`, :meth:`!importlib.machinery.WindowsRegistryFinder.find_module`, :meth:`!importlib.machinery.PathFinder.find_module`, :meth:`!importlib.abc.MetaPathFinder.find_module` ), :meth:`!importlib.abc.PathEntryFinder.find_module` ( :meth:`!importlib.machinery.FileFinder.find_module` ), and :meth:`!importlib.abc.PathEntryFinder.find_loader` ( :meth:`!importlib.machinery.FileFinder.find_loader` ) now raise :exc:`DeprecationWarning` and are slated for removal in Python 3.12 (previously they were documented as deprecated in Python 3.4). (Contributed by Brett Cannon in :issue:`42135`.)
:class:`!importlib.abc.Finder` is deprecated (including its sole method, :meth:`!find_module`). Both :class:`importlib.abc.MetaPathFinder` and :class:`importlib.abc.PathEntryFinder` no longer inherit from the class. Users should inherit from one of these two classes as appropriate instead. (Contributed by Brett Cannon in :issue:`42135`.)
:meth:`!importlib.abc.Loader.module_repr`, :meth:`!importlib.machinery.FrozenImporter.module_repr`, and :meth:`!importlib.machinery.BuiltinImporter.module_repr` are deprecated and slated for removal in Python 3.12. (Contributed by Brett Cannon in :issue:`42136`.)
``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python 3.3, when it was made an alias to :class:`str`. It is now deprecated, scheduled for removal in Python 3.12. (Contributed by Erlend E. Aasland in :issue:`42264`.)
The undocumented built-in function ``sqlite3.enable_shared_cache`` is now deprecated, scheduled for removal in Python 3.12. Its use is strongly discouraged by the SQLite3 documentation. See `the SQLite3 docs <https://sqlite.org/c3ref/enable_shared_cache.html>`_ for more details. If a shared cache must be used, open the database in URI mode using the ``cache=shared`` query parameter. (Contributed by Erlend E. Aasland in :issue:`24464`.)
The following ``threading`` methods are now deprecated:
:meth:`!pathlib.Path.link_to` is deprecated and slated for removal in Python 3.12. Use :meth:`pathlib.Path.hardlink_to` instead. (Contributed by Barney Gale in :issue:`39950`.)
``cgi.log()`` is deprecated and slated for removal in Python 3.12. (Contributed by Inada Naoki in :issue:`41139`.)
The following :mod:`ssl` features have been deprecated since Python 3.6, Python 3.7, or OpenSSL 1.1.0 and will be removed in 3.11:
:data:`!PROTOCOL_SSLv2`, :data:`!PROTOCOL_SSLv3`, :data:`!PROTOCOL_SSLv23`, :data:`!PROTOCOL_TLSv1`, :data:`!PROTOCOL_TLSv1_1`, :data:`!PROTOCOL_TLSv1_2`, and :const:`!PROTOCOL_TLS` are deprecated in favor of :const:`~ssl.PROTOCOL_TLS_CLIENT` and :const:`~ssl.PROTOCOL_TLS_SERVER`
The threading debug (:envvar:`!PYTHONTHREADDEBUG` environment variable) is deprecated in Python 3.10 and will be removed in Python 3.12. This feature requires a :ref:`debug build of Python <debug-build>`. (Contributed by Victor Stinner in :issue:`44584`.)
Removed the ``parser`` module, which was deprecated in 3.9 due to the switch to the new PEG parser, as well as all the C source and header files that were only being used by the old parser, including ``node.h``, ``parser.h``, ``graminit.h`` and ``grammar.h``.
Removed the Public C API functions ``PyParser_SimpleParseStringFlags``, ``PyParser_SimpleParseStringFlagsFilename``, ``PyParser_SimpleParseFileFlags`` and ``PyNode_Compile`` that were deprecated in 3.9 due to the switch to the new PEG parser.
Removed the ``formatter`` module, which was deprecated in Python 3.4. It is somewhat obsolete, little used, and not tested. It was originally scheduled to be removed in Python 3.6, but such removals were delayed until after Python 2.7 EOL. Existing users should copy whatever classes they use into their code. (Contributed by Donghee Na and Terry J. Reedy in :issue:`42299`.)
Remove deprecated aliases to :ref:`collections-abstract-base-classes` from the :mod:`collections` module. (Contributed by Victor Stinner in :issue:`37324`.)
The ``PyUnicode_InternImmortal()`` function is now deprecated and will be removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. (Contributed by Victor Stinner in :issue:`41692`.)
The deprecated :mod:`!mailcap` module now refuses to inject unsafe text (filenames, MIME types, parameters) into shell commands. Instead of using such text, it will warn and act as if a match was not found (or for test commands, as if the test failed). (Contributed by Petr Viktorin in :gh:`98966`.)