diff --git a/pythonx/compose/_reexport.py b/pythonx/compose/_reexport.py index 834ff1c..58c128d 100644 --- a/pythonx/compose/_reexport.py +++ b/pythonx/compose/_reexport.py @@ -43,6 +43,7 @@ import inspect import re import sys +import types import weakref from functools import lru_cache from pathlib import Path @@ -214,6 +215,10 @@ def __repr__(self): def _pythonic(value, name): + if isinstance(value, types.ModuleType): + # A Kotlin object served as a sub-package. Since python-multiplatform #35 the binder lists it + # and exposes it as an attribute of its parent, so the name table reaches it directly. + return KotlinObject(value) if isinstance(value, type) or not callable(value): return value return PythonicFunction(value, name)