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

2016-05-20 Thread Martin Panter
Martin Panter added the comment: iter-builtins-flag.patch has support for built-in modules via the builtins=True flag, but I removed the support for frozen modules. -- stage: -> patch review Added file: http://bugs.python.org/file42916/iter-builtins-flag.patch

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

2016-05-14 Thread Nick Coghlan
Nick Coghlan added the comment: To answer Brett's question about "Why does walk_packages import parent modules?", the answer is "Because __init__ can modify __path__, so if you don't import the parent module, you may miss things that actually doing the import would find". The classic example

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

2016-05-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2f19766d4b20 by Martin Panter in branch '3.5': Issue #25533: Update documentation regarding the frozen modules table https://hg.python.org/cpython/rev/2f19766d4b20 New changeset b20b580bc186 by Martin Panter in branch 'default': Issue #25533: Merge

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

2016-05-14 Thread Martin Panter
Martin Panter added the comment: It looks like Issue 1644818 is the one for built-in _packages_. I might wind back the frozen module stuff and go back to just builtins and sys.path searching. The two problems were the existing frozen packages that print stuff out for the test suite, and the

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

2015-11-19 Thread Brett Cannon
Brett Cannon added the comment: I say let it go and make sure the docs clearly document that only modules found off of sys.path are supported. Otherwise I would look at why walk_packages() and pydoc feel the need to import every module and if import simply needs to be tweaked to support this

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

2015-11-18 Thread Martin Panter
Martin Panter added the comment: I did some work on adding support for frozen modules, but I got stuck. The low level is fine: >>> pprint(sys.get_frozen_modules()) # (name, ispkg) pairs (('_frozen_importlib', False), ('_frozen_importlib_external', False), ('__hello__', False),

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

2015-11-03 Thread Brett Cannon
Brett Cannon added the comment: The lack of a way to list frozen modules was why I brought it up. :) And built-in packages are not currently supported, but they theoretically could be if someone put in the work (I think there's an issue for that somewhere). --

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

2015-11-02 Thread R. David Murray
R. David Murray added the comment: IMO, definitely this should not be changed by default. An alternative to a boolean flag would be a new function (iter_all_modules?). -- nosy: +r.david.murray ___ Python tracker

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

2015-11-02 Thread R. David Murray
Changes by R. David Murray : -- nosy: +brett.cannon ___ Python tracker ___ ___

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

2015-11-02 Thread Brett Cannon
Brett Cannon added the comment: How would this handle frozen modules? -- ___ Python tracker ___ ___

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

2015-11-02 Thread Martin Panter
New submission from Martin Panter: When no specific list of paths are given, pkgutil.iter_modules() and walk_packages() will list modules found on sys.path. But they don’t list built-in modules, which don’t live in a particular directory. So many users of these APIs (such as the ModuleScanner

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

2015-11-02 Thread Martin Panter
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