diff options
Diffstat (limited to 'tests/micropython/viper.py')
-rw-r--r-- | tests/micropython/viper.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/micropython/viper.py b/tests/micropython/viper.py index 2ed70ade6..36849abaf 100644 --- a/tests/micropython/viper.py +++ b/tests/micropython/viper.py @@ -29,6 +29,13 @@ def viper_sum(a:int, b:int) -> int: total += x return total +# accessing a global +@micropython.viper +def access_global(): + global gl + gl = 1 + return gl + # this doesn't work at the moment #@micropython.viper #def g() -> uint: @@ -39,3 +46,4 @@ print(g(1, 2)) print(h(3)) print(i(4, 5)) print(viper_sum(10, 10000)) +print(access_global(), gl) |