Skip to content

Type hints for Bidict type #221

Answered by jab
BD103 asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, that is correct. You can use reveal_type to have mypy confirm this for you:

# demo.py
from bidict import bidict

b = bidict({"H": "hydrogen", "C": "carbon"})
reveal_type(b)
$ mypy demo.py
demo.py:4: note: Revealed type is "bidict._bidict.bidict[builtins.str*, builtins.str*]"

What package are you creating that uses bidict?

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jab
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #212 on January 03, 2022 17:01.