When you run Python code, once the Python interpreter encounters a
function definition, it automatically compiles it to Python bytecode.
That's nothing specific to RPython. Also, decorators are only
syntactic sugar and are also just executed by Python itself (refer to
the Python docs).

The bytecode of a function can also be accessed (read-only) via
`func.func_code.co_code` - it's just a binary string. `func.func_code`
itself is an code-object (refer to the Python docs). You can use the
`dis` module to get a human-readable version of the bytecode.



On Thu, Jun 20, 2013 at 5:43 PM, Radek Falhar <[email protected]> wrote:
> I started studying RPython and I find it's way of metaprogramming through
> first running Python interpret over source and then compiling from
> internally generated objects interesting.
> I would like to ask how does RPython do it exactly? Where can I find it in
> RPython's compiler and if there is more detailed information about this
> practice?
>
> _______________________________________________
> pypy-dev mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/pypy-dev
>
_______________________________________________
pypy-dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to