Author Victor.Varvariuc
Recipients Victor.Varvariuc, barry, brett.cannon, eric.snow, gvanrossum, irdb, ncoghlan
Date 2017-04-10.05:58:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> it is possible for module a to override its attribute b without updating sys.modules

This sounds like a really strange application.

Even if someone overrides the attribute, when you do in other place `import a.b.c as m` you expect `a.b.c` to be path to a module, otherwise it would be hard to debug. 

The docs say `import_stmt     ::=  "import" module ["as" name]` meaning everywhere that `module` is a path to a module.

> To begin the search, Python needs the fully qualified name of the module (or package, but for the purposes of this discussion, the difference is immaterial) being imported. This name may come from various arguments to the import statement, or from the parameters to the importlib.import_module() or __import__() functions.

So if you treat `import a.b.c as m` as `import a; m = a.b.c` -- it go go in some cases against the docs.
Date User Action Args
2017-04-10 05:58:03Victor.Varvariucsetrecipients: + Victor.Varvariuc, gvanrossum, barry, brett.cannon, ncoghlan, irdb, eric.snow
2017-04-10 05:58:03Victor.Varvariucsetmessageid: <>
2017-04-10 05:58:03Victor.Varvariuclinkissue30024 messages
2017-04-10 05:58:03Victor.Varvariuccreate