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
{{ message }}
Repository navigation
Wrong "Overloaded function implementation does not accept all possible arguments" #11004
You may have already figured this out, but there is a simple workaround. If you change the second overload to include an explicit row_factory parameter, it will type check without errors.
This isn't a bug? As currently written, the second overload accepts Connection().connect(row_factory=10) and the implementation signature does not, so mypy warns about a real problem.
Activity
erictraut commentedon Aug 21, 2021
You may have already figured this out, but there is a simple workaround. If you change the second overload to include an explicit
row_factoryparameter, it will type check without errors.dvarrazzo commentedon Aug 21, 2021
@erictraut No, I didn't notice that, thank you. It is interesting, however I prefer to use a
type: ignorerather than a dummy parameter.Another thing that makes the error go is to use
**kwargs: Anyin the second signature.dlax commentedon Aug 23, 2021
I think that's the issue I tried to resolve in #10390.
dvarrazzo commentedon Aug 23, 2021
Amazing @dlax, didn't know you had looked into it so much to propose a MR! 🙂
adam-grant-hendry commentedon Jul 5, 2022
@dlax Do you plan to merge the change soon?
dlax commentedon Jul 6, 2022
@adam-grant-hendry, the PR is still pending review; and then possible merge by a project member.
sterliakov commentedon Mar 26, 2025
This isn't a bug? As currently written, the second overload accepts
Connection().connect(row_factory=10)and the implementation signature does not, somypywarns about a real problem.