diff options
author | Yoctopuce dev <dev@yoctopuce.com> | 2025-05-20 15:57:11 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2025-06-23 16:05:12 +1000 |
commit | 66c01480226aaf880a9d6e88340772bd53bc0421 (patch) | |
tree | b9b27e2c3705cc44c8548c230e4e808fc578863a /tests/float/math_constants_extra.py | |
parent | 35f15cfdf2a04a0ad290d70383fc3e4be4f79812 (diff) | |
download | micropython-66c01480226aaf880a9d6e88340772bd53bc0421.tar.gz micropython-66c01480226aaf880a9d6e88340772bd53bc0421.zip |
py/runtime: Add support for using __all__ in star import.
When the symbol `__all__` is defined in a module, `mp_import_all()` should
import all listed symbols into the global environment, rather than relying
on the underscore-is-private default. This is the standard in CPython.
Each item is loaded in the same way as if it would be an explicit import
statement, and will invoke the module's `__getattr__` function if needed.
This provides a straightforward solution for fixing star import of modules
using a dynamic loader, such as `extmod/asyncio` (see issue #7266).
This improvement has been enabled at BASIC_FEATURES level, to avoid
impacting devices with limited ressources, for which star import is of
little use anyway.
Additionally, detailled reporting of errors during `__all__` import has
been implemented to match CPython, but this is only enabled when
ERROR_REPORTING is set to MICROPY_ERROR_REPORTING_DETAILED.
Signed-off-by: Yoctopuce dev <dev@yoctopuce.com>
Diffstat (limited to 'tests/float/math_constants_extra.py')
0 files changed, 0 insertions, 0 deletions