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

Strange typing issue with JsonObject #12

Open
camertron opened this issue Jan 21, 2021 · 1 comment
Open

Strange typing issue with JsonObject #12

camertron opened this issue Jan 21, 2021 · 1 comment

Comments

@camertron
Copy link

We encountered a bug today that I would have expected mypy to catch. Our code looks something like this:

from aiocometd.typing import JsonObject

def some_func(response_message: JsonObject) -> None:
    reveal_type(response_message)

Mypy output:

file.py: note: In member "some_func":
file.py:203:25: note: Revealed type is 'Any'

I can see that aiocometd defines JsonObjectto be a Dict[str, Any], so why does mypy think the response_message is of type Any?

This might be a mypy bug, but I thought I'd ask here first.

@camertron
Copy link
Author

Ah ok I didn't realize we had explicitly added an ignore for aiocometd to our mypy.ini, apologies! Removing the ignores however results in a bunch of warnings of the form "Cannot find implementation or library stub for module named 'aiocometd.typing'" Any ideas? If not feel free to close this issue.

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

No branches or pull requests

1 participant