Skip to content

Commit f5b36d2

Browse files
committed
fix: instance protocol classvars
1 parent cb6f696 commit f5b36d2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fgpyo/util/inspect.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def get_attr_fields_dict(cls: type) -> Dict[str, dataclasses.Field]: # type: ig
7272
from _typeshed import DataclassInstance
7373
else:
7474

75+
# https://github.com/python/typeshed/blob/727f3c4320d2af3af2f16695e24dd78e79b7c070/stdlib/_typeshed/__init__.pyi#L348
7576
class DataclassInstance(Protocol):
7677
__dataclasses_fields__: ClassVar[Dict[str, dataclasses.Field[Any]]]
7778

@@ -80,8 +81,9 @@ class DataclassInstance(Protocol):
8081
from attr import AttrsInstance
8182
else:
8283

84+
# https://github.com/python-attrs/attrs/blob/f7f317ae4c3790f23ae027db626593d50e8a4e88/src/attr/_typing_compat.pyi#L9
8385
class AttrsInstance(Protocol): # type: ignore[no-redef]
84-
__attrs_attrs__: ClassVar[Dict[str, Any]]
86+
__attrs_attrs__: ClassVar[Any]
8587

8688

8789
def is_attr_class(cls: type) -> bool: # type: ignore[arg-type]

0 commit comments

Comments
 (0)