On Sun, Jan 11, 2015 at 10:31 PM, Steven D'Aprano <st...@pearwood.info> wrote:
> But bizarrely, you can import os.path this way!
>
> py> import os.path
> py> os.path
> <module 'posixpath' from '/usr/local/lib/python3.3/posixpath.py'>
> py> os.__package__
> ''
>
>
>
> By what wizardry does this work?

By the wizardry of adding an entry to sys.modules.

https://hg.python.org/cpython/file/8b3c609f3f73/Lib/os.py#l112
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to