bpo-41905: Add abc.update_abstractmethods() (GH-22485)

This function recomputes `cls.__abstractmethods__`.
Also update `@dataclass` to use it.
This commit is contained in:
Ben Avrahami 2020-10-06 20:40:50 +03:00 committed by GitHub
parent a8bf44d049
commit bef7d299eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 256 additions and 5 deletions

View file

@ -254,6 +254,13 @@ The :mod:`functools` module defines the following functions:
application, implementing all six rich comparison methods instead is
likely to provide an easy speed boost.
.. note::
This decorator makes no attempt to override methods that have been
declared in the class *or its superclasses*. Meaning that if a
superclass defines a comparison operator, *total_ordering* will not
implement it again, even if the original method is abstract.
.. versionadded:: 3.2
.. versionchanged:: 3.4