circuitpython/tests/cpydiff/core_function_userattr.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
263 B
Python
Raw Normal View History

"""
categories: Core,Functions
description: User-defined attributes for functions are not supported
cause: MicroPython is highly optimized for memory usage.
workaround: Use external dictionary, e.g. ``FUNC_X[f] = 0``.
"""
2021-03-15 09:57:36 -04:00
def f():
pass
2021-03-15 09:57:36 -04:00
f.x = 0
print(f.x)