Skip to content

Commit 81cd492

Browse files
hauntsaninjaJukkaL
authored andcommitted
Fix slicing with nonstrict optional (#21282)
Fixes #21261 I didn't add a regression test because you need custom fixtures and I just don't think any nonstrict optional change is worth the trouble
1 parent 908d344 commit 81cd492

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mypy/typeanal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2120,7 +2120,7 @@ def fix_instance(
21202120
t.args = tuple(args)
21212121
fix_type_var_tuple_argument(t)
21222122
if not t.type.has_type_var_tuple_type:
2123-
with state.strict_optional_set(options.strict_optional):
2123+
with state.strict_optional_set(True):
21242124
fixed = expand_type(t, env)
21252125
assert isinstance(fixed, Instance)
21262126
t.args = fixed.args

0 commit comments

Comments
 (0)