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

Function check_deletable_declaration

mypyc/irbuild/classdef.py:836–853  ·  view source on GitHub ↗
(builder: IRBuilder, cl: ClassIR, line: int)

Source from the content-addressed store, hash-verified

834
835
836def check_deletable_declaration(builder: IRBuilder, cl: ClassIR, line: int) -> None:
837 for attr in cl.deletable:
838 if attr not in cl.attributes:
839 if not cl.has_attr(attr):
840 builder.error(f'Attribute "{attr}" not defined', line)
841 continue
842 for base in cl.mro:
843 if attr in base.property_types:
844 builder.error(f'Cannot make property "{attr}" deletable', line)
845 break
846 else:
847 _, base = cl.attr_details(attr)
848 builder.error(
849 ('Attribute "{}" not defined in "{}" ' + '(defined in "{}")').format(
850 attr, cl.name, base.name
851 ),
852 line,
853 )
854
855
856def create_ne_from_eq(builder: IRBuilder, cdef: ClassDef) -> None:

Callers 1

find_attr_initializersFunction · 0.85

Calls 4

has_attrMethod · 0.80
attr_detailsMethod · 0.80
errorMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…