Skip to content

Commit 86e1080

Browse files
lolpackmeta-codesync[bot]
authored andcommitted
Add website documentation for strict-callable-subtyping config option
Summary: This config option controls whether Pyrefly enforces strict parameter compatibility for callables with `*args: Any, **kwargs: Any`. Reviewed By: rchen152 Differential Revision: D100025118 fbshipit-source-id: 768d65ba4f14bb3a6286a1a64d3a1bd68830915b
1 parent 7df2cd6 commit 86e1080

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

website/docs/configuration.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,26 @@ set `infer-return-types` to `"never"` in your config or pass it as a flag.
679679
- Default: `"checked"`
680680
- Flag equivalent: `--infer-return-types`
681681

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)
697+
698+
- Type: `bool`
699+
- Default: `false`
700+
- Flag equivalent: `--strict-callable-subtyping`
701+
682702
### `untyped-def-behavior` (deprecated)
683703

684704
:::warning

0 commit comments

Comments
 (0)