Steve Dower <steve.do...@python.org> added the comment:

Here's a trivial workaround for the import hook problem:

Assume we have "my_module.foo", and the import hook enables importing foo files.

Instead of just shipping "my_module.foo", you ship "my_module.py" and 
"_my_module.foo", where "my_module.py" looks like:

    import my_import_hook
    my_import_hook.install()

    from _my_module import *

This really isn't hard to do. As a bonus, you don't even need a full import 
hook anymore - you can use any kind of loader you want. And it should be fully 
backwards compatible (assuming special tricks weren't part of your public API), 
so your users won't even notice the upgrade.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33944>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to