Teks sumber — English
Terjemahan — Bahasa Indonesia
Deprecated
Usang
Deprecated Python behavior
Deprecated Python modules, functions and methods
The :mod:`!asynchat` has been deprecated in favor of :mod:`asyncio`. (Contributed by Mariatta in :issue:`25002`.)
The :mod:`!asyncore` has been deprecated in favor of :mod:`asyncio`. (Contributed by Mariatta in :issue:`25002`.)
Unlike other :mod:`dbm` implementations, the :mod:`dbm.dumb` module creates databases with the ``'rw'`` mode and allows modifying the database opened with the ``'r'`` mode. This behavior is now deprecated and will be removed in 3.8. (Contributed by Serhiy Storchaka in :issue:`21708`.)
The undocumented ``extra_path`` argument to the ``distutils.Distribution`` constructor is now considered deprecated and will raise a warning if set. Support for this parameter will be removed in a future Python release. See :issue:`27919` for details.
The support of non-integer arguments in :func:`~grp.getgrgid` has been deprecated. (Contributed by Serhiy Storchaka in :issue:`26129`.)
The ``importlib.machinery.SourceFileLoader.load_module`` and ``importlib.machinery.SourcelessFileLoader.load_module`` methods are now deprecated. They were the only remaining implementations of ``importlib.abc.Loader.load_module`` in :mod:`importlib` that had not been deprecated in previous versions of Python in favour of :meth:`importlib.abc.Loader.exec_module`.
The :class:`importlib.machinery.WindowsRegistryFinder` class is now deprecated. As of 3.6.0, it is still added to :data:`sys.meta_path` by default (on Windows), but this may change in future releases.
Undocumented support of general :term:`bytes-like objects <bytes-like object>` as paths in :mod:`os` functions, :func:`compile` and similar functions is now deprecated. (Contributed by Serhiy Storchaka in :issue:`25791` and :issue:`26754`.)
Support for inline flags ``(?letters)`` in the middle of the regular expression has been deprecated and will be removed in a future Python version. Flags at the start of a regular expression are still allowed. (Contributed by Serhiy Storchaka in :issue:`22493`.)
OpenSSL 0.9.8, 1.0.0 and 1.0.1 are deprecated and no longer supported. In the future the :mod:`ssl` module will require at least OpenSSL 1.0.2 or 1.1.0.
SSL-related arguments like ``certfile``, ``keyfile`` and ``check_hostname`` in :mod:`ftplib`, :mod:`http.client`, :mod:`imaplib`, :mod:`poplib`, and :mod:`smtplib` have been deprecated in favor of ``context``. (Contributed by Christian Heimes in :issue:`28022`.)
A couple of protocols and functions of the :mod:`ssl` module are now deprecated. Some features will no longer be available in future versions of OpenSSL. Other features are deprecated in favor of a different API. (Contributed by Christian Heimes in :issue:`28022` and :issue:`26470`.)
The :mod:`!tkinter.tix` module is now deprecated. :mod:`tkinter` users should use :mod:`tkinter.ttk` instead.
The ``pyvenv`` script has been deprecated in favour of ``python3 -m venv``. This prevents confusion as to what Python interpreter ``pyvenv`` is connected to and thus what Python interpreter will be used by the virtual environment. (Contributed by Brett Cannon in :issue:`25154`.)
Deprecated functions and types of the C API
Undocumented functions :c:func:`!PyUnicode_AsEncodedObject`, :c:func:`!PyUnicode_AsDecodedObject`, :c:func:`!PyUnicode_AsEncodedUnicode` and :c:func:`!PyUnicode_AsDecodedUnicode` are deprecated now. Use the :ref:`generic codec based API <codec-registry>` instead.
Deprecated Build Options
The ``--with-system-ffi`` configure flag is now on by default on non-macOS UNIX platforms. It may be disabled by using ``--without-system-ffi``, but using the flag is deprecated and will not be accepted in Python 3.7. macOS is unaffected by this change. Note that many OS distributors already use the ``--with-system-ffi`` flag when building their system Python.
Unknown escapes consisting of ``'\'`` and an ASCII letter in regular expressions will now cause an error. In replacement templates for :func:`re.sub` they are still allowed, but deprecated. The :const:`re.LOCALE` flag can now only be used with binary patterns.
``inspect.getmoduleinfo()`` was removed (was deprecated since CPython 3.3). :func:`inspect.getmodulename` should be used for obtaining the module name for a given path. (Contributed by Yury Selivanov in :issue:`13248`.)
``trace.Ignore`` class and ``trace.usage``, ``trace.modname``, ``trace.fullmodname``, ``trace.find_lines_from_code``, ``trace.find_lines``, ``trace.find_strings``, ``trace.find_executable_linenos`` methods were removed from the :mod:`trace` module. They were undocumented methods deprecated since Python 3.2 and equivalent functionality is available from private methods.
The :meth:`~zipfile.ZipFile.open` method of the :class:`zipfile.ZipFile` class no longer supports the ``'U'`` mode (was deprecated since Python 3.4). Use :class:`io.TextIOWrapper` for reading compressed text files in :term:`universal newlines` mode.
The deprecated ``asynchat.fifo`` class has been removed.