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

Method finalize

mypyc/irbuild/classdef.py:347–356  ·  view source on GitHub ↗
(self, ir: ClassIR)

Source from the content-addressed store, hash-verified

345 self.builder.init_final_static(lvalue, value, self.cdef.name)
346
347 def finalize(self, ir: ClassIR) -> None:
348 # Call __init_subclass__ after class attributes have been set
349 self.builder.call_c(py_init_subclass_op, [self.type_obj], self.cdef.line)
350
351 attrs_with_defaults, default_assignments = find_attr_initializers(
352 self.builder, self.cdef, self.skip_attr_default
353 )
354 ir.attrs_with_defaults.update(attrs_with_defaults)
355 generate_attr_defaults_init(self.builder, self.cdef, default_assignments)
356 create_ne_from_eq(self.builder, self.cdef)
357
358
359class DataClassBuilder(ExtClassBuilder):

Callers

nothing calls this directly

Calls 5

find_attr_initializersFunction · 0.85
create_ne_from_eqFunction · 0.85
call_cMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected