For improved stacktrace, i'd build the code above:

```python
code = "\n".join(meta['on_first'])
self.on_first = compile(code, self.name+".on_first()", 'exec')
```