Hi,

By playing around with importlib I noticed that if you define `__path__ =
[os.path.dirname(__file__)]` in a module named spam.py, then you could `import
spam.spam.spam` or `from spam import spam`. In other words, spam.py behaves
like a package although its loader, if asked, tells that it is not, and
that accordingly you cannot `from . import spam` (in the same file, after
setting `__path__`)

Is this intended behavior? (Maybe I should just get out more...)

Thanks!
Quentin
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to