Skip to content

another typing correction: Missing positional argument "stream" in call to "__call__" of "Encoder" #215

Open

Description

@brianmedigate

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.

I am using version 1.20.

Activity

  1. lelit commented on Sep 1, 2024

    @lelit
    Contributor

    Thank you, I will check.

  2. lelit commented on Sep 1, 2024

    @lelit
    Contributor

    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?

  3. brianmedigate commented on Sep 1, 2024

    @brianmedigate
    Author

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions