micropython/docs/reference
Damien George 079f3e5e5b py/parse: Allow all constant objects to be used in "X = const(o)".
Now that constant tuples are supported in the parser, eg (1, True, "str"),
it's a small step to allow anything that is a constant to be used with the
pattern:

    from micropython import const

    X = const(obj)

This commit makes the required changes to allow the following types of
constants:

    from micropython import const

    _INT = const(123)
    _FLOAT = const(1.2)
    _COMPLEX = const(3.4j)
    _STR = const("str")
    _BYTES = const(b"bytes")
    _TUPLE = const((_INT, _STR, _BYTES))
    _TUPLE2 = const((None, False, True, ..., (), _TUPLE))

Prior to this, only integers could be used in const(...).

Signed-off-by: Damien George <damien@micropython.org>
2022-05-18 16:18:35 +10:00
..
asm_thumb2_arith.rst
asm_thumb2_compare.rst
asm_thumb2_directives.rst
asm_thumb2_float.rst
asm_thumb2_hints_tips.rst
asm_thumb2_index.rst
asm_thumb2_label_branch.rst
asm_thumb2_ldr.rst
asm_thumb2_logical_bit.rst
asm_thumb2_misc.rst
asm_thumb2_mov.rst
asm_thumb2_stack.rst
asm_thumb2_str.rst
constrained.rst py/parse: Allow all constant objects to be used in "X = const(o)". 2022-05-18 16:18:35 +10:00
filesystem.rst
glossary.rst
index.rst
isr_rules.rst
manifest.rst
mpremote.rst tools/mpremote: Add option to mount cmd to allow "unsafe" symlinks. 2022-04-11 15:15:04 +10:00
mpyfiles.rst docs/reference/mpyfiles: Remove docs about mpy flags and qstr win size. 2022-05-17 12:51:54 +10:00
packages.rst
pyboard.py.rst
repl.rst
speed_python.rst