diff --git a/source/analysis/test/typeTest.ml b/source/analysis/test/typeTest.ml index 13c339d6108..7e877c01864 100644 --- a/source/analysis/test/typeTest.ml +++ b/source/analysis/test/typeTest.ml @@ -3704,8 +3704,8 @@ let test_parameter_create _ = (Type.Callable.CallableParamType.create [{ Type.Callable.CallableParamType.name = "__"; annotation = Type.integer; default = false }]) [ - Type.Callable.CallableParamType.PositionalOnly - { index = 0; annotation = Type.integer; default = false }; + Type.Callable.CallableParamType.Named + { name = "__"; annotation = Type.integer; default = false }; ] diff --git a/source/analysis/type.ml b/source/analysis/type.ml index ee503d15d43..b226f367c2c 100644 --- a/source/analysis/type.ml +++ b/source/analysis/type.ml @@ -1470,9 +1470,8 @@ module Callable = struct if (not keyword_only) && (not has_pep570_syntax) - && (String.equal sanitized "__" - || String.is_prefix sanitized ~prefix:"__" - && not (String.is_suffix sanitized ~suffix:"__")) + && String.is_prefix sanitized ~prefix:"__" + && not (String.is_suffix sanitized ~suffix:"__") then index + 1, CallableParamType.PositionalOnly { index; annotation; default } else diff --git a/source/interprocedural_analyses/taint/accessPath.ml b/source/interprocedural_analyses/taint/accessPath.ml index 90eb2271bf7..0563da69483 100644 --- a/source/interprocedural_analyses/taint/accessPath.ml +++ b/source/interprocedural_analyses/taint/accessPath.ml @@ -191,9 +191,8 @@ let normalize_parameters parameters = let positional_only = (not seen_star) && (not has_pep570_syntax) - && (String.equal unqualified_name "__" - || String.is_prefix unqualified_name ~prefix:"__" - && not (String.is_suffix unqualified_name ~suffix:"__")) + && String.is_prefix unqualified_name ~prefix:"__" + && not (String.is_suffix unqualified_name ~suffix:"__") in ( position + 1, false,