bpo-44633: Fix parameter substitution of the union type with wrong ty… · python/cpython@85b5829 · GitHub
Skip to content

Commit 85b5829

Browse files
bpo-44633: Fix parameter substitution of the union type with wrong types. (GH-27218) (GH-27224)
A TypeError is now raised instead of returning NotImplemented. (cherry picked from commit 3ea5332) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 03aad30 commit 85b5829

3 files changed

Lines changed: 36 additions & 16 deletions

File tree

Lib/test/test_types.py

Lines changed: 6 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Parameter substitution of the union type with wrong types now raises
2+
``TypeError`` instead of returning ``NotImplemented``.

Objects/unionobject.c

Lines changed: 28 additions & 16 deletions

0 commit comments

Comments
 (0)