Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Any type annotations. #791

Merged
merged 3 commits into from
May 31, 2022
Merged

Conversation

joouha
Copy link
Contributor

@joouha joouha commented May 26, 2022

In some places it appears that traitlets.Any is used in place of typing.Any for type annotations.

This causes mypy errors in projects which depend on jupyter_client, e.g.:

euporie/kernel.py: note: In member "start_" of class "NotebookKernel":
euporie/kernel.py:233: error: Argument "stdout" has incompatible type "int"; expected "traitlets.traitlets.Any"  [arg-type]
                await self.km.start_kernel(stdout=DEVNULL, stderr=STDOUT)
                                                  ^
euporie/kernel.py:233: error: Argument "stderr" has incompatible type "int"; expected "traitlets.traitlets.Any"  [arg-type]
                await self.km.start_kernel(stdout=DEVNULL, stderr=STDOUT)
                                                                  ^
euporie/kernel.py: note: In member "history_" of class "NotebookKernel":
euporie/kernel.py:670: error: Argument "pattern" to "history" of "KernelClient" has incompatible type "str"; expected "traitlets.traitlets.Any"  [arg-type]
            msg_id = self.kc.history(pattern=pattern, n=n, hist_access_type="search")
                                             ^
euporie/kernel.py:670: error: Argument "n" to "history" of "KernelClient" has incompatible type "int"; expected "traitlets.traitlets.Any"  [arg-type]
            msg_id = self.kc.history(pattern=pattern, n=n, hist_access_type="search")
                                                        ^

This PR fixes all the instances of this I could find.

@davidbrochart
Copy link
Member

davidbrochart commented May 26, 2022

Thanks a lot @joouha, I pushed more fixes and updated pyzmq >=23.0.
It looks like the callback passed to ZMQStream.on_recv accepts an argument that doesn't need to be awaited anymore with pyzmq v23.0. Could you confirm @minrk ?

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

Successfully merging this pull request may close these issues.

None yet

2 participants