Dict
takes two "arguments", the type of its keys and the type of its values. For a dict
that maps strings to integers, use
def doSomething(value: Dict[str, int]):
The documentation could probably be a little more explicit, though.
</p>
from typing import Dict
def doSomething(Some_Dict: Dict[str, SomeObject]):
then voila! your IDE will suggest the members of each value (SomeObject) in the dictionary!
Top comments (0)