summaryrefslogtreecommitdiffstatshomepage
path: root/tests/cpydiff/core_function_moduleattr.py
blob: 71747c1f409eeb3006974915bd3d6397635b8936 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
"""
categories: Core,Functions
description: Function objects do not have the ``__module__`` attribute
cause: MicroPython is optimized for reduced code size and RAM usage.
workaround: Use ``sys.modules[function.__globals__['__name__']]`` for non-builtin modules.
"""


def f():
    pass


print(f.__module__)