diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-10-12 23:24:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-12 23:24:37 (GMT) |
commit | 27d5ea291c16bcdfaad25e2e371c2ba3d591ed37 (patch) | |
tree | fab51b3a9719517043add07826e6d2b14b9b5e78 /Lib/test/test_typing.py | |
parent | 80f958529bc5c466add532df4c8dd314995f689f (diff) | |
download | cpython-27d5ea291c16bcdfaad25e2e371c2ba3d591ed37.zip cpython-27d5ea291c16bcdfaad25e2e371c2ba3d591ed37.tar.gz cpython-27d5ea291c16bcdfaad25e2e371c2ba3d591ed37.tar.bz2 |
[3.12] gh-110782: Fix crash when TypeVar is constructed with keyword args (GH-110784) (#110787)
gh-110782: Fix crash when TypeVar is constructed with keyword args (GH-110784)
(cherry picked from commit d2a536b1706d4a79303b7ac53684bb82eac2de23)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 03f03fe..957d7af 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -554,6 +554,12 @@ class TypeVarTests(BaseTestCase): vals[x] = cls(str(x)) del vals + def test_constructor(self): + T = TypeVar(name="T") + self.assertEqual(T.__name__, "T") + self.assertEqual(T.__constraints__, ()) + self.assertIs(T.__bound__, None) + def template_replace(templates: list[str], replacements: dict[str, list[str]]) -> list[tuple[str]]: """Renders templates with possible combinations of replacements. |