Delete EnumMeta.__setattr__ and EnumMeta.__delattr__ (#7388)

This commit is contained in:
Alex Waygood
2022-02-27 01:55:53 +00:00
committed by GitHub
parent 2d6ab4d3bf
commit 4f0d8c593e
2 changed files with 3 additions and 3 deletions

View File

@@ -91,7 +91,10 @@ class object:
def __class__(self, __type: type[object]) -> None: ... # type: ignore # noqa: F811
def __init__(self) -> None: ...
def __new__(cls: type[Self]) -> Self: ...
# N.B. `object.__setattr__` and `object.__delattr__` are heavily special-cased by type checkers.
# Overriding them in subclasses has different semantics, even if the override has an identical signature.
def __setattr__(self, __name: str, __value: Any) -> None: ...
def __delattr__(self, __name: str) -> None: ...
def __eq__(self, __o: object) -> bool: ...
def __ne__(self, __o: object) -> bool: ...
def __str__(self) -> str: ... # noqa Y029
@@ -99,7 +102,6 @@ class object:
def __hash__(self) -> int: ...
def __format__(self, __format_spec: str) -> str: ...
def __getattribute__(self, __name: str) -> Any: ...
def __delattr__(self, __name: str) -> None: ...
def __sizeof__(self) -> int: ...
# return type of pickle methods is rather hard to express in the current type system
# see #6661 and https://docs.python.org/3/library/pickle.html#object.__reduce__