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