MCPcopy Create free account
hub / github.com/python/mypy / is_init_only

Function is_init_only

mypy/semanal.py:8417–8421  ·  view source on GitHub ↗
(node: Var)

Source from the content-addressed store, hash-verified

8415
8416
8417def is_init_only(node: Var) -> bool:
8418 return (
8419 isinstance(type := get_proper_type(node.type), Instance)
8420 and type.type.fullname == "dataclasses.InitVar"
8421 )
8422
8423
8424def erase_func_annotations(func: FuncDef) -> None:

Callers 1

add_symbol_table_nodeMethod · 0.85

Calls 2

get_proper_typeFunction · 0.90
isinstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…