Skip to content

Commit cea9058

Browse files
authored
Match new parser behavior w.r.t. posonly args (#21891)
This matches behavior of the new parser to the old one. Not adding tests, since some existing tests fail when switched to new parser, see #21823
1 parent d32c4d3 commit cea9058

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mypy/nativeparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ def read_func_def(state: State, data: ReadBuffer) -> FuncDef:
672672
name = read_str(data)
673673
arguments, has_ann = read_parameters(state, data)
674674

675-
if special_function_elide_names(name):
675+
if state.options.pos_only_special_methods and special_function_elide_names(name):
676676
for arg in arguments:
677677
arg.pos_only = True
678678

0 commit comments

Comments
 (0)