circuitpython/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 docs: Add reference for Thumb2 inline assembler. 2015-06-25 00:21:35 +01:00
asm_thumb2_compare.rst docs: Add reference for Thumb2 inline assembler. 2015-06-25 00:21:35 +01:00
asm_thumb2_directives.rst docs: More consistent capitalization and use of articles in headings. 2020-01-06 22:17:29 +11:00
asm_thumb2_float.rst docs: More consistent capitalization and use of articles in headings. 2020-01-06 22:17:29 +11:00
asm_thumb2_hints_tips.rst docs: Remove trailing spaces and convert tabs to spaces. 2021-12-15 11:49:22 +11:00
asm_thumb2_index.rst docs: More consistent capitalization and use of articles in headings. 2020-01-06 22:17:29 +11:00
asm_thumb2_label_branch.rst docs: Spelling mistakes 2016-08-02 11:17:46 +03:00
asm_thumb2_ldr.rst docs: Add reference for Thumb2 inline assembler. 2015-06-25 00:21:35 +01:00
asm_thumb2_logical_bit.rst docs: More consistent capitalization and use of articles in headings. 2020-01-06 22:17:29 +11:00
asm_thumb2_misc.rst docs: Several minor changes: network, pyb, ADCAll and inline asm. 2016-01-13 21:53:26 +00:00
asm_thumb2_mov.rst py/inlinethumb: Remove 30-bit restriction on movwt instruction. 2016-01-07 16:34:11 +00:00
asm_thumb2_stack.rst docs: Add reference for Thumb2 inline assembler. 2015-06-25 00:21:35 +01:00
asm_thumb2_str.rst docs: Add reference for Thumb2 inline assembler. 2015-06-25 00:21:35 +01:00
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 docs/reference/filesystem.rst: Add detail on how to use littlefs fuse. 2021-11-19 15:13:05 +11:00
glossary.rst docs: Replace ufoo with foo in all docs. 2021-08-13 22:53:29 +10:00
index.rst docs/reference/manifest.rst: Add docs for manifest.py files. 2021-10-14 14:03:03 +11:00
isr_rules.rst docs/reference/isr_rules.rst: Describe uasyncio-IRQ interface. 2022-02-04 12:27:16 +11:00
manifest.rst docs/reference/manifest.rst: Add docs for manifest.py files. 2021-10-14 14:03:03 +11:00
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 docs/library/index.rst: Clarify module naming and purpose. 2021-08-13 23:14:08 +10:00
pyboard.py.rst tools: Add filesystem action examples to pyboard.py help. 2021-02-13 14:37:28 +11:00
repl.rst docs/reference/repl.rst: Add information about new raw-paste mode. 2020-12-01 22:35:13 +11:00
speed_python.rst docs: Remove trailing spaces and convert tabs to spaces. 2021-12-15 11:49:22 +11:00