Pending removal in Python 3.20¶
Calling the
__new__()method ofstruct.Structwithout the format argument is deprecated and will be removed in Python 3.20. Calling__init__()method on initializedStructobjects is deprecated and will be removed in Python 3.20.(Contributed by Sergey B Kirpichev and Serhiy Storchaka in gh-143715.)
The
__version__,versionandVERSIONattributes have been deprecated in these standard library modules and will be removed in Python 3.20. Usesys.version_infoinstead.ctypes.macholibdecimal(usedecimal.SPEC_VERSIONinstead)logging(__date__also deprecated)xml.sax.expatreader
(Contributed by Hugo van Kemenade and Stan Ulbrych in gh-76007.)
The
__author__,__credits__,__copyright__and__date__attributes have been deprecated in these standard library modules and will be removed in Python 3.20. Attribution is preserved in the source code and the version control history.(Contributed by Stan Ulbrych in gh-159240.)
Deprecations defined by PEP 829:
Warnings are produced for
importlines found inname.pthfiles.name.pthfiles are no longer decoded in the locale encoding by default. They MUST be encoded inutf-8-sig.
(Contributed by Barry Warsaw in gh-148641.)
ast:Creating instances of abstract AST nodes (such as
ast.ASTorast.expr) is deprecated and will raise an error in Python 3.20.
-
It is deprecated to call
isinstance()andissubclass()checks on protocol classes that were not explicitly decorated withruntime_checkable()but that inherit from a runtime-checkable protocol class. This will raise aTypeErrorin Python 3.20.(Contributed by Bartosz Sławecki in gh-132604.)