On 15 April 2018 at 17:12, Nick Coghlan <ncogh...@gmail.com> wrote: > If you want to do this dynamically relative to the current module, > then it's possible to do: > > global __path__ > __path__[:] = (some_directory, some_other_directory) > custom_mod = importlib.import_module(".name", package=__name__)
Copy and paste error there: to make this work in non-package modules, drop the "[:]" from the __path__ assignment. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/