summaryrefslogtreecommitdiff
path: root/tests/micropython/native_fun_attrs.py
blob: e61c869755403eef577bae25700848ea2ca573ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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")