Skip to content
Update Python subset for kernels authored by Leon Riesebos's avatar Leon Riesebos
......@@ -12,7 +12,7 @@ The kernel code supports a subset of the *Python 3.5* language. This section hig
1. Build-in Python functions `isinstance()` and `zip()` are not supported in kernels.
1. Hashing types, such as `dict()` and `set()` are not supported in kernels.
1. The keyword `yield` is not supported.
1. Kernels are not able to access class-private members (i.e. attributes with a double underscore name `self.__variable`) since the compiler is not able to resolve those names.
1. Kernels are not able to directly call class-private members (i.e. dunder attributes `self.__variable`) since the compiler is not able to resolve those names.
1. Kernel functions with dynamic arguments using `*args` and `**kwargs` are not supported.
1. `if` clauses in list comprehensions are not supported.
1. `with` statements are supported, but not in combination with `as`.
......@@ -25,6 +25,7 @@ The kernel code supports a subset of the *Python 3.5* language. This section hig
1. Opening multiple contexts with a single `with` statement (e.g. `with context_a, context_b: pass`).
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. Positional-only (`/`) and keyword-only arguments (`*`) can also be used.
1. RPC functions can have arguments with default values that are not supported in ARTIQ or do not obey ARTIQ typing (e.g. `def foo(v: TFloat = None)` is valid).
1. Since ARTIQ 6, element-wise operations are supported using the `TArray` type (equivalent to the NumPy array).
1. Since ARTIQ 6, assert statements using the `assert` keyword are supported and raise the expected exception type.
1. Since ARTIQ 6, trigonometric and other common math functions from NumPy are now available on the core device (e.g. `numpy.sin`).
......
......