You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/configuration.mdx
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -679,6 +679,26 @@ set `infer-return-types` to `"never"` in your config or pass it as a flag.
679
679
- Default: `"checked"`
680
680
- Flag equivalent: `--infer-return-types`
681
681
682
+
### `strict-callable-subtyping`
683
+
684
+
Controls whether Pyrefly enforces strict parameter compatibility when checking
685
+
callable subtyping for signatures with `*args: Any, **kwargs: Any`.
686
+
687
+
When set to `false` (the default), callables with `*args: Any, **kwargs: Any`
688
+
are treated as a gradual type — assignability checks in both directions succeed
689
+
when they otherwise wouldn't, similar to how `...` (ellipsis) parameters behave.
690
+
This is a pragmatic default because many real-world stubs and decorators use
691
+
`*args: Any, **kwargs: Any` as a wildcard signature.
692
+
693
+
When set to `true`, parameter list compatibility is checked strictly even when
694
+
`*args: Any, **kwargs: Any` is present.
695
+
696
+
[Try it in the sandbox.](https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxlKnHAAQCCiAOuvR-ZjGPWABRwYUMABp6AKlQAnAOZxxEiQGsA7jPkBKRPUJ621WgwBC-Rtrad6AYnoARHqgCuUAC71%2BYVFCHb66XHoYaWlcaXpAFAJ6DFJ6OAhZdFRXJ2kYeggGSlwAW2JkiGxYelUIVwALegADfik5OB1GdFJFFXV6xubNKstOWwBlV2kISnd%2BIacYP2DQ8Kia-B0IdFdurlx4f1x3VEpKGGIdqChouSccmBX6KEzXBgrk6tqNBqZm1rUXztI1zA24Xocbi8ARCETiRYZFZ%2BPSEECiEBkNJgKCkQiuXJQCi2AAKpGRqLiGBwBHo2XQkFkqQKuHQhDYAxg6XKrlcxAaAHoOUieKjCGFZBzLhy-pQ4BzyZTqa4ILSOXwwtEAG6oaCoIrpSUJaWy9i4Q66uD09BkCq0gC0SuC8Vp9AAvPQWCAAMyEACMACYnWw4EMRq5zZRvDQNea4E5sK5SMRlrJ7fQJjA2ABtGZhOAAXTYTnQEDyYVcMEw5swEDSowgVvjAHIEgE0tW2AEA2kAI5OMtF83KGCkc27fZ0GvtdCN9AgAC%2BCN2MqtADFoDAKGgsHgiGRJ0A)
0 commit comments