Re: [Python-Dev] __package__ attribute

2010-05-24 Thread Brett Cannon
On Fri, May 21, 2010 at 14:35, Andrew Svetlov wrote: > For me it's the real bug in standard python import machinery. > I don't see any backward incompatibilities. > There are very hard to write any import-depended code based on > decision: was module imported in absolute or relative way. > > If it

Re: [Python-Dev] __package__ attribute

2010-05-21 Thread Andrew Svetlov
For me it's the real bug in standard python import machinery. I don't see any backward incompatibilities. There are very hard to write any import-depended code based on decision: was module imported in absolute or relative way. If it's a bug I can create issue in python bugtracker and provide a pa

[Python-Dev] __package__ attribute

2010-05-21 Thread Andrew Svetlov
What are expected values for module.__package__? I see two different behaviors: importlib and standard python import. importlib processes __package__ pretty simple and clean: - for toplevel modules __package__ is empty string - for packages it's package name - for modules inside packages it's again