跳转到主要内容

Pending removal in Python 3.21

  • abc

    • Soft-deprecated since Python 3.3 abc.abstractclassmethod, abc.abstractstaticmethod, and abc.abstractproperty now raise a DeprecationWarning. These classes will be removed in Python 3.21, instead use abc.abstractmethod with classmethod, staticmethod, and property respectively.
  • ast:

    • Classes slice, Index, ExtSlice, Suite, Param, AugLoad and AugStore, will be removed in Python 3.21. These types are not generated by the parser or accepted by the code generator.
    • The dims property of ast.Tuple will be removed in Python 3.21. Use the ast.Tuple.elts property instead.
  • functools:

    • Using a return annotation to infer the dispatch type for functools.singledispatch or functools.singledispatchmethod is deprecated since Python 3.16 and will raise TypeError in Python 3.21. Annotate the dispatch parameter or pass the dispatch type explicitly instead. (Contributed by Bartosz Sławecki in 143465.)
  • struct:

    • Soft-deprecated since Python 3.15, using 'F' and 'D' type codes are now deprecated. These codes will be removed in Python 3.21. Use instead two-letter forms 'Zf' and 'Zd'.
  • tempfile:

    • tempfile._TemporaryFileWrapper will be removed in Python 3.21. Use the public tempfile.TemporaryFileWrapper instead.