Apply class decorators to create a decorated (non-extension) class object. Given a decorated ClassDef and a register containing a non-extension representation of the ClassDef created via the type constructor, applies the corresponding decorator functions on that decorated ClassDef a
(builder: IRBuilder, cdef: ClassDef, type_obj: Value)
| 916 | |
| 917 | |
| 918 | def load_decorated_class(builder: IRBuilder, cdef: ClassDef, type_obj: Value) -> Value: |
| 919 | """Apply class decorators to create a decorated (non-extension) class object. |
| 920 | |
| 921 | Given a decorated ClassDef and a register containing a |
| 922 | non-extension representation of the ClassDef created via the type |
| 923 | constructor, applies the corresponding decorator functions on that |
| 924 | decorated ClassDef and returns a register containing the decorated |
| 925 | ClassDef. |
| 926 | """ |
| 927 | decorators = cdef.decorators |
| 928 | dec_class = type_obj |
| 929 | for d in reversed(decorators): |
| 930 | decorator = d.accept(builder.visitor) |
| 931 | assert isinstance(decorator, Value), decorator |
| 932 | dec_class = builder.py_call(decorator, [dec_class], dec_class.line) |
| 933 | return dec_class |
| 934 | |
| 935 | |
| 936 | def cache_class_attrs( |
no test coverage detected
searching dependent graphs…