MCPcopy Index your code
hub / github.com/python/mypy / get_dict

Function get_dict

mypyc/test/test_serialization.py:19–23  ·  view source on GitHub ↗
(x: Any)

Source from the content-addressed store, hash-verified

17
18
19def get_dict(x: Any) -> dict[str, Any]:
20 if hasattr(x, "__mypyc_attrs__"):
21 return {k: getattr(x, k) for k in x.__mypyc_attrs__ if hasattr(x, k)}
22 else:
23 return dict(x.__dict__)
24
25
26def get_function_dict(x: FuncIR) -> dict[str, Any]:

Callers 2

get_function_dictFunction · 0.85
assert_modules_sameFunction · 0.85

Calls 3

hasattrFunction · 0.85
getattrFunction · 0.85
dictClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…