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

TypeDict and Mapping[Any, object] incompatibilities for unittest.assertDictEqual #11153

Open
SamuelMarks opened this issue Dec 11, 2023 · 1 comment

Comments

@SamuelMarks
Copy link

I've just added types to the common dictionary used throughout my codebase. But now my assertDictEqual gives a type error:

Expected type 'Mapping[Any, object]', got 'MyDictTypeName' instead

What's the trick here? - Should I narrow the types with a Union?

@srittau
Copy link
Collaborator

srittau commented Dec 12, 2023

Could you give a full example and the type checker (plus version) you are using? I just tried some examples with mypy 1.7.1 and that seemed to work.

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

2 participants