Teks sumber — English
Terjemahan — Bahasa Indonesia
The :func:`!async` function is deprecated in favor of :func:`~asyncio.ensure_future`. (Contributed by Yury Selivanov.)
A new :func:`~math.gcd` function has been added. The :func:`!fractions.gcd` function is now deprecated. (Contributed by Mark Dickinson and Serhiy Storchaka in :issue:`22486`.)
Deprecated
Usang
Deprecated Python Behavior
Perilaku Python yang Usang
Deprecated Python modules, functions and methods
The :func:`!asyncio.async` function is deprecated in favor of :func:`~asyncio.ensure_future`.
The :mod:`!smtpd` module has in the past always decoded the DATA portion of email messages using the ``utf-8`` codec. This can now be controlled by the new *decode_data* keyword to :class:`!SMTPServer`. The default value is ``True``, but this default is deprecated. Specify the *decode_data* keyword with an appropriate value to avoid the deprecation warning.
Directly assigning values to the :attr:`~http.cookies.Morsel.key`, :attr:`~http.cookies.Morsel.value` and :attr:`~http.cookies.Morsel.coded_value` of :class:`http.cookies.Morsel` objects is deprecated. Use the :meth:`~http.cookies.Morsel.set` method instead. In addition, the undocumented *LegalChars* parameter of :meth:`~http.cookies.Morsel.set` is deprecated, and is now ignored.
Passing a format string as keyword argument *format_string* to the :meth:`~string.Formatter.format` method of the :class:`string.Formatter` class has been deprecated. (Contributed by Serhiy Storchaka in :issue:`23671`.)
The :func:`!platform.dist` and :func:`!platform.linux_distribution` functions are now deprecated. Linux distributions use too many different ways of describing themselves, so the functionality is left to a package. (Contributed by Vajrasky Kok and Berker Peksag in :issue:`1322`.)
The previously undocumented ``from_function`` and ``from_builtin`` methods of :class:`inspect.Signature` are deprecated. Use the new :meth:`Signature.from_callable() <inspect.Signature.from_callable>` method instead. (Contributed by Yury Selivanov in :issue:`24248`.)
The :func:`!inspect.getargspec` function is deprecated and scheduled to be removed in Python 3.6. (See :issue:`20438` for details.)
The :mod:`inspect` :func:`~inspect.getfullargspec`, :func:`~inspect.getcallargs`, and :func:`!formatargspec` functions are deprecated in favor of the :func:`inspect.signature` API. (Contributed by Yury Selivanov in :issue:`20438`.)
:func:`~inspect.getargvalues` and :func:`~inspect.formatargvalues` functions were inadvertently marked as deprecated with the release of Python 3.5.0.
Use of :const:`re.LOCALE` flag with str patterns or :const:`re.ASCII` is now deprecated. (Contributed by Serhiy Storchaka in :issue:`22407`.)
The undocumented and unofficial *use_load_tests* default argument of the :meth:`unittest.TestLoader.loadTestsFromModule` method now is deprecated and ignored. (Contributed by Robert Collins and Barry A. Warsaw in :issue:`16662`.)
The following obsolete and previously deprecated APIs and features have been removed:
The internal ``Netrc`` class in the :mod:`ftplib` module was deprecated in 3.4, and has now been removed. (Contributed by Matt Chaput in :issue:`6623`.)
The JoinableQueue class in the provisional :mod:`asyncio` module was deprecated in 3.4.4 and is now removed. (Contributed by A. Jesse Jiryu Davis in :issue:`23464`.)
The deprecated "strict" mode and argument of :class:`~html.parser.HTMLParser`, :meth:`!HTMLParser.error`, and the :exc:`!HTMLParserError` exception have been removed. (Contributed by Ezio Melotti in :issue:`15114`.) The *convert_charrefs* argument of :class:`~html.parser.HTMLParser` is now ``True`` by default. (Contributed by Berker Peksag in :issue:`21047`.)
The :class:`http.cookies.Morsel` dict-like interface has been made self consistent: morsel comparison now takes the :attr:`~http.cookies.Morsel.key` and :attr:`~http.cookies.Morsel.value` into account, :meth:`~http.cookies.Morsel.copy` now results in a :class:`~http.cookies.Morsel` instance rather than a :class:`dict`, and :meth:`~http.cookies.Morsel.update` will now raise an exception if any of the keys in the update dictionary are invalid. In addition, the undocumented *LegalChars* parameter of :func:`~http.cookies.Morsel.set` is deprecated and is now ignored. (Contributed by Demian Brecht in :issue:`2211`.)
:pep:`488` has removed ``.pyo`` files from Python and introduced the optional ``opt-`` tag in ``.pyc`` file names. The :func:`importlib.util.cache_from_source` has gained an *optimization* parameter to help control the ``opt-`` tag. Because of this, the *debug_override* parameter of the function is now deprecated. ``.pyo`` files are also no longer supported as a file argument to the Python interpreter and thus serve no purpose when distributed on their own (i.e. sourceless code distribution). Due to the fact that the magic number for bytecode has changed in Python 3.5, all old ``.pyo`` files from previous versions of Python are invalid regardless of this PEP.