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

Function mypy_any_typing

tests/test_typing.py:286–304  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

284
285@pytest.mark.mypy_testing
286def mypy_any_typing() -> None:
287 class T(HasTraits):
288 attributes = Any(
289 config=True,
290 default_value={
291 "a": ["href", "title"],
292 "abbr": ["title"],
293 "acronym": ["title"],
294 },
295 help="Allowed HTML tag attributes",
296 )
297
298 t = T()
299 reveal_type(Any("foo")) # R: traitlets.traitlets.Any
300 reveal_type(Any("").tag(sync=True)) # R: traitlets.traitlets.Any
301 reveal_type(Any(None, allow_none=True)) # R: traitlets.traitlets.Any
302 reveal_type(Any(None, allow_none=True).tag(sync=True)) # R: traitlets.traitlets.Any
303 reveal_type(T.attributes) # R: traitlets.traitlets.Any
304 reveal_type(t.attributes) # R: Any
305
306
307@pytest.mark.mypy_testing

Callers

nothing calls this directly

Calls 4

AnyClass · 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…