Update Python subset for kernels authored by Leon Riesebos's avatar Leon Riesebos
......@@ -20,10 +20,12 @@ The kernel code supports a subset of the *Python 3.5* language. This section hig
1. Ranges (i.e. `range()`) and the `len()` function are supported.
1. Operators `round()`, `abs()`, `min()`, and `max()`.
1. Multiple return values for a kernel function is supported.
1. Opening multiple contexts with a single `with` statement (e.g. `with context_a, context_b: pass`)
1. Opening multiple contexts with a single `with` statement (e.g. `with context_a, context_b: pass`) [^w].
1. It is possible to add typing annotations to function definitions. Typing for variables is not supported since Python 3.5 does not support the syntax. More information on kernel typing can be found on the [Kernel typing page](ARTIQ/Kernel-typing).
1. RPC functions with dynamic arguments using `*args` and `**kwargs` can be called from kernel context.
[^w]: There is a known compiler bug when opening multiple contexts with a single `with` statement (see [this issue](https://github.com/m-labs/artiq/issues/1478)). As a workaround, we recommend to open every context in a separate `with` statement.
### Performance
There is a lot to say about code performance, but there is one principle that stands out mostly.
......
......