diff options
author | Yurii Karabas <1998uriyyo@gmail.com> | 2021-09-08 10:25:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-08 10:25:09 (GMT) |
commit | c11956a8bddd75f02ccc7b4da7e4d8123e1f3c5f (patch) | |
tree | b3c94d1e1dbfda311a8b94fe5a0918df7ac0a121 /Lib/test/test_typing.py | |
parent | d003a5bd2505a7fa04f50504b68ba8fca67349cd (diff) | |
download | cpython-c11956a8bddd75f02ccc7b4da7e4d8123e1f3c5f.zip cpython-c11956a8bddd75f02ccc7b4da7e4d8123e1f3c5f.tar.gz cpython-c11956a8bddd75f02ccc7b4da7e4d8123e1f3c5f.tar.bz2 |
bpo-45121: Fix RecursionError when calling Protocol.__init__ from a subclass' __init__ (GH-28206)
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 847d583..fa49b90 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -1610,6 +1610,16 @@ class ProtocolTests(BaseTestCase): with self.assertRaisesRegex(TypeError, "@runtime_checkable"): isinstance(1, P) + def test_super_call_init(self): + class P(Protocol): + x: int + + class Foo(P): + def __init__(self): + super().__init__() + + Foo() # Previously triggered RecursionError + class GenericTests(BaseTestCase): |