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

Function check_final_member

mypy/checkmember.py:659–664  ·  view source on GitHub ↗

Give an error if the name being assigned was declared as final.

(name: str, info: TypeInfo, msg: MessageBuilder, ctx: Context)

Source from the content-addressed store, hash-verified

657
658
659def check_final_member(name: str, info: TypeInfo, msg: MessageBuilder, ctx: Context) -> None:
660 """Give an error if the name being assigned was declared as final."""
661 for base in info.mro:
662 sym = base.names.get(name)
663 if sym and is_final_node(sym.node):
664 msg.cant_assign_to_final(name, attr_assign=True, ctx=ctx)
665
666
667def analyze_descriptor_access(descriptor_type: Type, mx: MemberContext) -> Type:

Callers 2

Calls 3

is_final_nodeFunction · 0.90
cant_assign_to_finalMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…