Code: Select all
MicroPython v1.9.1 on 2017-06-11; PYBv1.1 with STM32F405RG
Type "help()" for more information.
>>> x = const(1)
>>> y = const(1<<2)
>>> z = const(x+1)
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: constant must be an integer
>>> z = const(int('1'))
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: constant must be an integer
>>>
Doc says:
so I would expect z=const(x+1) to work.It can even include other const symbols that have already been defined, e.g. 1 << BIT.
Should I expect z=const(int('1)) to work?