tests/cpydiff/core_function_userattr: Clarify, fill in cause and workaround.
This commit is contained in:
parent
58ecbc7752
commit
8bb84cc627
@ -1,11 +0,0 @@
|
||||
"""
|
||||
categories: Core,Functions
|
||||
description: Assign instance variable to function
|
||||
cause: Unknown
|
||||
workaround: Unknown
|
||||
"""
|
||||
def f():
|
||||
pass
|
||||
|
||||
f.x = 0
|
||||
print(f.x)
|
11
tests/cpydiff/core_function_userattr.py
Normal file
11
tests/cpydiff/core_function_userattr.py
Normal file
@ -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)
|
Loading…
x
Reference in New Issue
Block a user