Open
Description
Describe the bug
The type hints introduced in 7.3.0 appear to be incomplete and enabling the reportIncompatibleMethodOverride = true
setting in pyright highlights this (mypy detects this out-of-the-box). For example:
/tmp/stripe-python/stripe/api_resources/account.py
/tmp/stripe-python/stripe/api_resources/account.py:3475:9 - error: Method "create" overrides class "CreateableAPIResource" in an incompatible manner
Parameter "**params" has no corresponding parameter (reportIncompatibleMethodOverride)
/tmp/stripe-python/stripe/api_resources/account.py:3507:9 - error: Method "_cls_delete" overrides class "DeletableAPIResource" in an incompatible manner
Parameter "**params" has no corresponding parameter (reportIncompatibleMethodOverride)
/tmp/stripe-python/stripe/api_resources/account.py:3549:9 - error: Method "delete" overrides class "DeletableAPIResource" in an incompatible manner
No overload signature in override is compatible with base method (reportIncompatibleMethodOverride)
/tmp/stripe-python/stripe/api_resources/account.py:3566:9 - error: Method "list" overrides class "ListableAPIResource" in an incompatible manner
Parameter "**params" has no corresponding parameter (reportIncompatibleMethodOverride)
/tmp/stripe-python/stripe/api_resources/account.py:3773:9 - error: Method "modify" overrides class "UpdateableAPIResource" in an incompatible manner
Parameter 2 name mismatch: base parameter is named "sid", override parameter is named "id" (reportIncompatibleMethodOverride)
/tmp/stripe-python/stripe/api_resources/account_link.py
...
The root cause of many of these seems to be that the use of typed dict to define parameters for e.g. delete methods makes child methods more restrictive than the parent method (which is an untyped dict), thus violating the Liskov substitution principle. There are other small examples here though.
To Reproduce
Enable reportIncompatibleMethodOverride = true
in pyright configuration in pyproject.toml
.
Expected behavior
No errors when the reportIncompatibleMethodOverride = true
option is enabled in pyright.
Code snippets
No response
OS
Linux
Language version
Python 3.11
Library version
master
API version
n/a
Additional context
No response