core_function_userattr.py 260 B

1234567891011
  1. """
  2. categories: Core,Functions
  3. description: User-defined attributes for functions are not supported
  4. cause: MicroPython is highly optimized for memory usage.
  5. workaround: Use external dictionary, e.g. ``FUNC_X[f] = 0``.
  6. """
  7. def f():
  8. pass
  9. f.x = 0
  10. print(f.x)