@@ -68,10 +68,13 @@ class SkipTest(Exception):
6868
6969class _SupportsAbsAndDunderGE (SupportsDunderGE [Any ], SupportsAbs [Any ], Protocol ): ...
7070
71+ # Keep this alias in sync with builtins._ClassInfo
72+ # We can't import it from builtins or pytype crashes,
73+ # due to the fact that pytype uses a custom builtins stub rather than typeshed's builtins stub
7174if sys .version_info >= (3 , 10 ):
72- _IsInstanceClassInfo : TypeAlias = type | UnionType | tuple [type | UnionType | tuple [ Any , ...] , ...]
75+ _ClassInfo : TypeAlias = type | UnionType | tuple [_ClassInfo , ...]
7376else :
74- _IsInstanceClassInfo : TypeAlias = type | tuple [type | tuple [ Any , ...] , ...]
77+ _ClassInfo : TypeAlias = type | tuple [_ClassInfo , ...]
7578
7679class TestCase :
7780 failureException : type [BaseException ]
@@ -107,8 +110,8 @@ class TestCase:
107110 def assertIsNotNone (self , obj : object , msg : Any = None ) -> None : ...
108111 def assertIn (self , member : Any , container : Iterable [Any ] | Container [Any ], msg : Any = None ) -> None : ...
109112 def assertNotIn (self , member : Any , container : Iterable [Any ] | Container [Any ], msg : Any = None ) -> None : ...
110- def assertIsInstance (self , obj : object , cls : _IsInstanceClassInfo , msg : Any = None ) -> None : ...
111- def assertNotIsInstance (self , obj : object , cls : _IsInstanceClassInfo , msg : Any = None ) -> None : ...
113+ def assertIsInstance (self , obj : object , cls : _ClassInfo , msg : Any = None ) -> None : ...
114+ def assertNotIsInstance (self , obj : object , cls : _ClassInfo , msg : Any = None ) -> None : ...
112115 @overload
113116 def assertGreater (self , a : SupportsDunderGT [_T ], b : _T , msg : Any = None ) -> None : ...
114117 @overload
0 commit comments