
Has it irritated anyone else that this syntax is invalid? I've wanted it a couple of times, to be equivalent to: import foo.bar.baz from foo import bar del foo # but only if we didn't import foo already before" The idea being that one wants access to foo.bar.baz under the name bar.baz , for readability purposes or what have you. I played around with adding this, but I seem to have really bad luck with extending CPython... -- Devin

+1 Indeed, I would have expected that "from foo import bar.baz" would work. On 05/26/2012 12:54 AM, Devin Jeanpierre wrote:
Has it irritated anyone else that this syntax is invalid? I've wanted it a couple of times, to be equivalent to:
import foo.bar.baz from foo import bar del foo # but only if we didn't import foo already before"
The idea being that one wants access to foo.bar.baz under the name bar.baz , for readability purposes or what have you.
I played around with adding this, but I seem to have really bad luck with extending CPython...
-- Devin

On Sat, May 26, 2012 at 1:54 AM, Devin Jeanpierre <jeanpierreda@gmail.com> wrote:
Has it irritated anyone else that this syntax is invalid? I've wanted it a couple of times, to be equivalent to:
import foo.bar.baz from foo import bar del foo # but only if we didn't import foo already before"
The idea being that one wants access to foo.bar.baz under the name bar.baz , for readability purposes or what have you.
+1
I played around with adding this, but I seem to have really bad luck with extending CPython...
TryPyPy? =)
participants (3)
-
anatoly techtonik
-
Devin Jeanpierre
-
Mathias Panzenböck