kopia lustrzana https://github.com/micropython/micropython
25ff5b52d9
Allows optimisation of cases like: import micropython _DEBUG = micropython.const(False) if _DEBUG: print('Debugging info') Previously the 'if' statement was only optimised out if the type of the const() argument was integer. The change is implemented in a way that makes the compiler slightly smaller (-16 bytes on PYBV11) but compilation will also be very slightly slower. As a bonus, if const support is enabled then the compiler can now optimise const truthy/falsey expressions of other types, like: while "something": pass ... unclear if that is useful, but perhaps it could be. Signed-off-by: Angus Gratton <angus@redyak.com.au> |
||
---|---|---|
.. | ||
cmd_optimise.py | ||
cmd_optimise.py.exp | ||
cmd_parsetree.py | ||
cmd_parsetree.py.exp | ||
cmd_showbc.py | ||
cmd_showbc.py.exp | ||
cmd_showbc_const.py | ||
cmd_showbc_const.py.exp | ||
cmd_showbc_opt.py | ||
cmd_showbc_opt.py.exp | ||
cmd_verbose.py | ||
cmd_verbose.py.exp | ||
repl_autocomplete.py | ||
repl_autocomplete.py.exp | ||
repl_autoindent.py | ||
repl_autoindent.py.exp | ||
repl_basic.py | ||
repl_basic.py.exp | ||
repl_cont.py | ||
repl_cont.py.exp | ||
repl_emacs_keys.py | ||
repl_emacs_keys.py.exp | ||
repl_inspect.py | ||
repl_inspect.py.exp | ||
repl_micropyinspect | ||
repl_micropyinspect.py | ||
repl_micropyinspect.py.exp | ||
repl_sys_ps1_ps2.py | ||
repl_sys_ps1_ps2.py.exp | ||
repl_words_move.py | ||
repl_words_move.py.exp |