A functools.partial-like class for adding symbol table entries.
| 176 | |
| 177 | |
| 178 | class SymbolTableEntry: |
| 179 | """A functools.partial-like class for adding symbol table entries.""" |
| 180 | |
| 181 | def __init__(self, symbol_table, apply_name, o_len, pure): |
| 182 | self.symbol_table = symbol_table |
| 183 | self.apply_name = apply_name |
| 184 | self.o_len = o_len |
| 185 | self.pure = pure |
| 186 | |
| 187 | def __call__(self, *args, **kwargs): |
| 188 | return self.symbol_table._new_apply( |
| 189 | self.apply_name, args, kwargs, self.o_len, self.pure |
| 190 | ) |
| 191 | |
| 192 | |
| 193 | scope = SymbolTable() |