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

Function validate_super_call

mypy/checkmember.py:392–404  ·  view source on GitHub ↗
(node: FuncBase, mx: MemberContext)

Source from the content-addressed store, hash-verified

390
391
392def validate_super_call(node: FuncBase, mx: MemberContext) -> None:
393 unsafe_super = False
394 if isinstance(node, FuncDef) and node.is_trivial_body:
395 unsafe_super = True
396 elif isinstance(node, OverloadedFuncDef):
397 if node.impl:
398 impl = node.impl if isinstance(node.impl, FuncDef) else node.impl.func
399 unsafe_super = impl.is_trivial_body
400 elif not node.is_property and node.items:
401 assert isinstance(node.items[0], Decorator)
402 unsafe_super = node.items[0].func.is_trivial_body
403 if unsafe_super:
404 mx.msg.unsafe_super(node.name, node.info.name, mx.context)
405
406
407def analyze_type_callable_member_access(name: str, typ: FunctionLike, mx: MemberContext) -> Type:

Callers 2

Calls 2

isinstanceFunction · 0.85
unsafe_superMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…