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

BUG: Type errors instantiating zmq.asyncio.Context #2028

Open
1 task done
obeattie opened this issue Aug 31, 2024 · 3 comments · May be fixed by #2032
Open
1 task done

BUG: Type errors instantiating zmq.asyncio.Context #2028

obeattie opened this issue Aug 31, 2024 · 3 comments · May be fixed by #2032

Comments

@obeattie
Copy link

This is a pyzmq bug

  • This is a pyzmq-specific bug, not an issue of zmq socket behavior. Don't worry if you're not sure! We'll figure it out together.

What pyzmq version?

26.2.0

What libzmq version?

4.3.5

Python version (and how it was installed)

Python 3.12.5

OS

macOS 14.5 (23F79)

What happened?

When instantiating an zmq.asyncio.Context exactly as described in the docs, I get a type error:

Screenshot 2024-08-31 at 8 14 43 AM

Everything is functionally fine if I add a # type: ignore to ignore the type error, but of course not ideal to have to do that!

Code to reproduce bug

import zmq.asyncio

zmq_context = zmq.asyncio.Context()

Traceback, if applicable

No response

More info

No response

@minrk
Copy link
Member

minrk commented Aug 31, 2024

Can you share more of how you are doing the type checking? Because all the type checking tests pass, so it might be a problem in the env or checker.

@minrk minrk linked a pull request Sep 12, 2024 that will close this issue
@minrk
Copy link
Member

minrk commented Sep 12, 2024

Looks like pyright doesn't understand the use of generics the same way mypy does. Fixed by #2032.

@obeattie
Copy link
Author

Sorry I didn’t see the earlier reply. And thanks for fixing it! ❤️

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

Successfully merging a pull request may close this issue.

2 participants