gh-124787: Fix `TypeAliasType` and incorrect `type_params` (#124795) · python/cpython@2115d76 · GitHub
Skip to content

Commit 2115d76

Browse files
gh-124787: Fix TypeAliasType and incorrect type_params (#124795)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent b3aa1b5 commit 2115d76

3 files changed

Lines changed: 133 additions & 12 deletions

File tree

Lib/test/test_type_aliases.py

Lines changed: 43 additions & 1 deletion
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fix :class:`typing.TypeAliasType` with incorrect ``type_params`` argument.
2+
Now it raises a :exc:`TypeError` when a type parameter without a default
3+
follows one with a default, and when an entry in the ``type_params`` tuple
4+
is not a type parameter object.

Objects/typevarobject.c

Lines changed: 86 additions & 11 deletions

0 commit comments

Comments
 (0)