(ctx: DynamicClassDefContext)
| 24 | |
| 25 | |
| 26 | def add_info_hook(ctx: DynamicClassDefContext) -> None: |
| 27 | class_def = ClassDef(ctx.name, Block([])) |
| 28 | class_def.fullname = ctx.api.qualified_name(ctx.name) |
| 29 | |
| 30 | info = TypeInfo(SymbolTable(), class_def, ctx.api.cur_mod_id) |
| 31 | class_def.info = info |
| 32 | obj = ctx.api.named_type("builtins.object") |
| 33 | info.mro = [info, obj.type] |
| 34 | info.bases = [obj] |
| 35 | ctx.api.add_symbol_table_node(ctx.name, SymbolTableNode(GDEF, info)) |
| 36 | DECL_BASES.add(class_def.fullname) |
| 37 | |
| 38 | |
| 39 | def replace_col_hook(ctx: ClassDefContext) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…