diff options
author | Damien George <damien.p.george@gmail.com> | 2017-01-22 12:12:54 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-01-22 12:12:54 +1100 |
commit | f5172af1c430cd3c20f83b8e7fe0d3ffb812e1ac (patch) | |
tree | 5552cb81395ed539d4569cc9972ca2011c6e4d3b /py/mpconfig.h | |
parent | 9de91914fb7520bd946b87b1832a002c5725f7e8 (diff) |
py/builtinhelp: Implement help('modules') to list available modules.
This is how CPython does it, and it's very useful to help users discover
the available modules for a given port, especially built-in and frozen
modules. The function does not list modules that are in the filesystem
because this would require a fair bit of work to do correctly, and is very
port specific (depending on the filesystem).
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r-- | py/mpconfig.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h index 70ad98daa..3bccada11 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -770,6 +770,11 @@ typedef double mp_float_t; #define MICROPY_PY_BUILTINS_HELP_TEXT mp_help_default_text #endif +// Add the ability to list the available modules when executing help('modules') +#ifndef MICROPY_PY_BUILTINS_HELP_MODULES +#define MICROPY_PY_BUILTINS_HELP_MODULES (0) +#endif + // Whether to set __file__ for imported modules #ifndef MICROPY_PY___FILE__ #define MICROPY_PY___FILE__ (1) |