[issue25533] Make pkgutil.iter_modules() yield built-in modules

Martin Panter report at bugs.python.org
Mon Nov 2 21:51:13 EST 2015


Martin Panter added the comment:

My patch doesn’t handle frozen modules. Maybe we need a new sys.frozen_module_names API, or a sys.list_frozen_module_names() function if it is meant to be dynamic. All I could find was <https://docs.python.org/dev/library/ctypes.html#accessing-values-exported-from-dlls> (which needs updating for Python 3’s byte strings).

A related point: Are built-in packages possible? My patch doesn’t anticipate them either.

If adding a new iter_all_modules() function, there should probably be a matching walk_all_packages() function. But under the hood they would all probably use the same internal functions with a flag.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25533>
_______________________________________


More information about the Python-bugs-list mailing list