Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "import Foo as Bar" syntax #3895

Closed
stevengj opened this issue Jul 31, 2013 · 3 comments
Closed

Support "import Foo as Bar" syntax #3895

stevengj opened this issue Jul 31, 2013 · 3 comments

Comments

@stevengj
Copy link
Member

Similar to Python, import Foo as Bar would import the Foo module in a variable named Bar, so that you would access the Foo namespace as Bar.foo. This could even be just syntactic sugar for:

import Foo
Bar = Foo

if we don't mind having Foo in the namespace too, but hiding Foo would probably be better.

Useful when you don't want to pollute the global namespace (hence don't want using) but would like a short module name for convenience.

@lindahua
Copy link
Contributor

+1 for this syntax.

@kmsquire
Copy link
Member

Dup of #1255.

@pao
Copy link
Member

pao commented Jul 31, 2013

Closing as dup of #1255 per @kmsquire.

@pao pao closed this as completed Jul 31, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants