aboutsummaryrefslogtreecommitdiff
path: root/tests/cpydiff/core_function_userattr.py
diff options
context:
space:
mode:
authorPaul Sokolovsky2017-05-02 03:42:46 +0300
committerPaul Sokolovsky2017-05-02 03:43:21 +0300
commit8bb84cc627b933ff3eb9931a97197e459811fe36 (patch)
tree495651d1ad93052ccaaee7566b6f0407de00869b /tests/cpydiff/core_function_userattr.py
parent58ecbc7752116be123598daec7c2be77d8681f8c (diff)
tests/cpydiff/core_function_userattr: Clarify, fill in cause and workaround.
Diffstat (limited to 'tests/cpydiff/core_function_userattr.py')
-rw-r--r--tests/cpydiff/core_function_userattr.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/cpydiff/core_function_userattr.py b/tests/cpydiff/core_function_userattr.py
new file mode 100644
index 000000000..297293908
--- /dev/null
+++ b/tests/cpydiff/core_function_userattr.py
@@ -0,0 +1,11 @@
+"""
+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``.
+"""
+def f():
+ pass
+
+f.x = 0
+print(f.x)