mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
bpo-41905: Add abc.update_abstractmethods() (GH-22485)
This function recomputes `cls.__abstractmethods__`. Also update `@dataclass` to use it.
This commit is contained in:
parent
a8bf44d049
commit
bef7d299eb
7 changed files with 256 additions and 5 deletions
|
@ -6,6 +6,7 @@ import inspect
|
|||
import keyword
|
||||
import builtins
|
||||
import functools
|
||||
import abc
|
||||
import _thread
|
||||
from types import GenericAlias
|
||||
|
||||
|
@ -992,6 +993,8 @@ def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen):
|
|||
cls.__doc__ = (cls.__name__ +
|
||||
str(inspect.signature(cls)).replace(' -> None', ''))
|
||||
|
||||
abc.update_abstractmethods(cls)
|
||||
|
||||
return cls
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue