core_locals.py 322 B

1234567891011
  1. """
  2. categories: Core,Runtime
  3. description: Local variables aren't included in locals() result
  4. cause: MicroPython doesn't maintain symbolic local environment, it is optimized to an array of slots. Thus, local variables can't be accessed by a name.
  5. workaround: Unknown
  6. """
  7. def test():
  8. val = 2
  9. print(locals())
  10. test()