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
another typing correction: Missing positional argument "stream" in call to "__call__" of "Encoder"Â #215
It looks like the type hint for Encoder.__call__() is missing the default value for the stream parameter. Mypy warns that I didn't pass the argument, but in practice it doesn't seem to be required.
Can you try out referenced commit and confirm it fixes the problem?
I wonder if there is a recommended way to build a test suite against typing stubs, any suggestion?
Another approach that might work is the crowdsourced one: take representative open source projects which use python-rapidjson and are well typed, and run mypy on them with new versions of the package to see if anything breaks.
Activity
lelit commentedon Sep 1, 2024
Thank you, I will check.
Fix typing declaration of Encoder.__call__()
lelit commentedon Sep 1, 2024
Can you try out referenced commit and confirm it fixes the problem?
I wonder if there is a recommended way to build a test suite against typing stubs, any suggestion?
brianmedigate commentedon Sep 1, 2024
yeah looks good, thanks!
hmm good question, I'm not sure I'm an expert there.
I would start by checking out stubtest: https://mypy.readthedocs.io/en/stable/stubtest.html, which should work for extension modules if they export their signatures correctly.
Another approach that might work is the crowdsourced one: take representative open source projects which use python-rapidjson and are well typed, and run mypy on them with new versions of the package to see if anything breaks.
Fix typing declaration of Encoder.__call__()