Skip to content

Commit 8bb84cc

Browse files
committed
tests/cpydiff/core_function_userattr: Clarify, fill in cause and workaround.
1 parent 58ecbc7 commit 8bb84cc

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/cpydiff/core_function_instancevar.py

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
10+
f.x = 0
11+
print(f.x)

0 commit comments

Comments
 (0)