mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-28556: Fix regression that sneaked into recent typing updates (GH-270)
This commit is contained in:
parent
6059ce45aa
commit
365cb5bb90
2 changed files with 12 additions and 1 deletions
|
@ -701,6 +701,14 @@ class GenericTests(BaseTestCase):
|
|||
self.assertEqual(D.x, 'from derived x')
|
||||
self.assertEqual(D[str].z, 'from derived z')
|
||||
|
||||
def test_abc_registry_kept(self):
|
||||
T = TypeVar('T')
|
||||
class C(Generic[T]): ...
|
||||
C.register(int)
|
||||
self.assertIsInstance(1, C)
|
||||
C[int]
|
||||
self.assertIsInstance(1, C)
|
||||
|
||||
def test_false_subclasses(self):
|
||||
class MyMapping(MutableMapping[str, str]): pass
|
||||
self.assertNotIsInstance({}, MyMapping)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue