Fix type annotation for resolve_types() (#1141)
This commit is contained in:
parent
747b9ded2f
commit
ecdb117407
|
@ -0,0 +1 @@
|
|||
The type annotation for `attrs.resolve_types()` is now correct.
|
|
@ -69,8 +69,7 @@ _ValidatorArgType = Union[_ValidatorType[_T], Sequence[_ValidatorType[_T]]]
|
|||
class AttrsInstance(AttrsInstance_, Protocol):
|
||||
pass
|
||||
|
||||
_A = TypeVar("_A", bound=AttrsInstance)
|
||||
# _make --
|
||||
_A = TypeVar("_A", bound=type[AttrsInstance])
|
||||
|
||||
class _Nothing(enum.Enum):
|
||||
NOTHING = enum.auto()
|
||||
|
|
|
@ -468,3 +468,8 @@ if attrs.has(foo) or attr.has(foo):
|
|||
@attrs.define(unsafe_hash=True)
|
||||
class Hashable:
|
||||
pass
|
||||
|
||||
|
||||
def test(cls: type) -> None:
|
||||
if attr.has(cls):
|
||||
attr.resolve_types(cls)
|
||||
|
|
Loading…
Reference in New Issue