Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'master' into fix-typeis-for-types-with-type-params-in-u…
…nions
  • Loading branch information
JelleZijlstra authored Oct 8, 2024
commit 7cfdd8fefdc193c713a5120164e3ad8cecd802d7
2 changes: 2 additions & 0 deletions mypy/subtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,8 @@ def restrict_subtype_away(t: Type, s: Type) -> Type:
if isinstance(get_proper_type(item), UnionType) or not covers_type(item, s)
]
return UnionType.make_union(new_items)
elif isinstance(p_t, TypeVarType):
return p_t.copy_modified(upper_bound=restrict_subtype_away(p_t.upper_bound, s))
elif covers_type(t, s):
return UninhabitedType()
else:
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.