Barry "5 String" Warsaw wrote: > But I think it /is/ useful behavior for "import <dotted name> as" > to bind the rightmost attribute to the local name. That is certainly what I would expect (and thus the confusion created by my original post). > I agree > though that if that can't be done in a sane way, it has to raise > an exception. But that will frustrate users. "as" is minorly useful in dealing with name clashes between packages, and with reallyreallylongmodulename. Unfortunately, it's also yet another way of screwing up circular imports and reloads, (unless you go whole hog, and use Jim Fulton's idea of an assoctiation object). Then there's all the things that can go wrong with relative imports (loading the same module twice; masking anything outside the package with the same name). It's not surprising that most import problems posted to c.l.py get more wrong answers than right. Unfortunately, there's no way to fix it in a backwards compatible way. So I'm -0: it just adds complexity to an already overly complex area. - Gordon
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4