MCPcopy Create free account
hub / github.com/ipython/traitlets / mypy_dict_typing

Function mypy_dict_typing

tests/test_typing.py:114–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112
113@pytest.mark.mypy_testing
114def mypy_dict_typing() -> None:
115 class T(HasTraits):
116 foo = Dict({}, help="Shell command used to compile latex.").tag(config=True)
117
118 t = T()
119 reveal_type(Dict(None, allow_none=True)) # R: traitlets.traitlets.Dict[builtins.str, Any]
120 reveal_type(
121 Dict(None, allow_none=True).tag(sync=True) # R: traitlets.traitlets.Dict[builtins.str, Any]
122 )
123 reveal_type(T.foo) # R: traitlets.traitlets.Dict[builtins.str, Any]
124 reveal_type(t.foo) # R: builtins.dict[builtins.str, Any]
125
126
127@pytest.mark.mypy_testing

Callers

nothing calls this directly

Calls 4

DictClass · 0.90
TClass · 0.85
reveal_typeFunction · 0.85
tagMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…