Merge branch 'master' into 3.2

This commit is contained in:
Rémi Verschelde
2020-07-06 14:23:58 +02:00
18 changed files with 103 additions and 37 deletions

View File

@@ -629,7 +629,7 @@ expressions and must be assigned on initialization.
const E = [1, 2, 3, 4][0] # Constant expression: 1.
const F = sin(20) # 'sin()' can be used in constant expressions.
const G = x + 20 # Invalid; this is not a constant expression!
const H = A + 20 # Constant expression: 25.
const H = A + 20 # Constant expression: 25 (`A` is a constant).
Although the type of constants is inferred from the assigned value, it's also
possible to add explicit type specification::
@@ -639,6 +639,12 @@ possible to add explicit type specification::
Assigning a value of an incompatible type will raise an error.
.. note::
Since arrays and dictionaries are passed by reference, constants are "flat".
This means that if you declare a constant array or dictionary, it can still
be modified afterwards. They can't be reassigned with another value though.
Enums
^^^^^
@@ -1571,7 +1577,7 @@ multiple times, you can yield to the ``completed`` signal conditionally:
return result
This ensures that the function returns whatever it was supposed to return
irregardless of whether coroutines were used internally. Note that using
regardless of whether coroutines were used internally. Note that using
``while`` would be redundant here as the ``completed`` signal is only emitted
when the function didn't yield anymore.