e22b7fb4af
Native functions can just reuse the bytecode function attribute code. Signed-off-by: Damien George <damien@micropython.org>
26 lines
367 B
Python
26 lines
367 B
Python
# test native function attributes
|
|
|
|
|
|
def f():
|
|
pass
|
|
|
|
|
|
if not hasattr(f, "__name__"):
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
|
|
@micropython.native
|
|
def native_f():
|
|
pass
|
|
|
|
|
|
print(type(native_f.__name__))
|
|
print(type(native_f.__globals__))
|
|
print(native_f.__globals__ is globals())
|
|
|
|
try:
|
|
native_f.__name__ = None
|
|
except AttributeError:
|
|
print("AttributeError")
|