File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 2
2
import types as python_types
3
3
import typing
4
4
from typing import Any
5
+ from typing import ClassVar
5
6
from typing import Dict
6
7
from typing import FrozenSet
7
8
from typing import Iterable
@@ -71,16 +72,18 @@ def get_attr_fields_dict(cls: type) -> Dict[str, dataclasses.Field]: # type: ig
71
72
from _typeshed import DataclassInstance
72
73
else :
73
74
75
+ # https://github.com/python/typeshed/blob/727f3c4320d2af3af2f16695e24dd78e79b7c070/stdlib/_typeshed/__init__.pyi#L348
74
76
class DataclassInstance (Protocol ):
75
- __dataclasses_fields__ : Dict [str , dataclasses .Field ]
77
+ __dataclasses_fields__ : ClassVar [ Dict [str , dataclasses .Field [ Any ]] ]
76
78
77
79
78
80
if TYPE_CHECKING and _use_attr : # pragma: no cover
79
81
from attr import AttrsInstance
80
82
else :
81
83
84
+ # https://github.com/python-attrs/attrs/blob/f7f317ae4c3790f23ae027db626593d50e8a4e88/src/attr/_typing_compat.pyi#L9
82
85
class AttrsInstance (Protocol ): # type: ignore[no-redef]
83
- __attrs_attrs__ : Dict [ str , Any ]
86
+ __attrs_attrs__ : ClassVar [ Any ]
84
87
85
88
86
89
def is_attr_class (cls : type ) -> bool : # type: ignore[arg-type]
You can’t perform that action at this time.
0 commit comments