File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ from . import validators as validators
2727from ._cmp import cmp_using as cmp_using
2828from ._version_info import VersionInfo
2929
30+
31+ if sys .version_info >= (3 , 10 ):
32+ from typing import TypeGuard
33+ else :
34+ from typing_extensions import TypeGuard
35+
3036__version__ : str
3137__version_info__ : VersionInfo
3238__title__ : str
@@ -470,15 +476,7 @@ def astuple(
470476 tuple_factory : Type [Sequence [Any ]] = ...,
471477 retain_collection_types : bool = ...,
472478) -> Tuple [Any , ...]: ...
473-
474- if sys .version_info >= (3 , 10 ):
475- from typing import TypeGuard
476-
477- def has (cls : type ) -> TypeGuard [Type [AttrsInstance ]]: ...
478-
479- else :
480- def has (cls : type ) -> bool : ...
481-
479+ def has (cls : type ) -> TypeGuard [Type [AttrsInstance ]]: ...
482480def assoc (inst : _T , ** changes : Any ) -> _T : ...
483481def evolve (inst : _T , ** changes : Any ) -> _T : ...
484482
Original file line number Diff line number Diff line change 13731373 fields(A) # E: Argument 1 to "fields" has incompatible type "Type[A]"; expected "Type[AttrsInstance]"
13741374
13751375 - case : testHasTypeGuard
1376- skip : sys.version_info < (3, 10)
13771376 main : |
13781377 from attrs import define, has
13791378
You can’t perform that action at this time.
0 commit comments