-
Notifications
You must be signed in to change notification settings - Fork 421
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
Design and implement import
as alternative to use
#13119
Comments
I think that From #13524 (comment)
|
@mppf: I'm not familiar enough with Python to know: Does the behavior you propose for |
@bradcray - I think this would be similar to Python's Here is an example: # mymodule.py
import othermodule
def myfn():
print("myfn")
print ("Hello from mymodule") # othermodule.py
def otherfn():
print("otherfn")
print ("Hello from othermodule") # program.py
import mymodule
mymodule.myfn()
mymodule.othermodule.otherfn()
|
@bradcray - if it's not obvious, accepting my proposal would make moving to |
I just opened #13831 |
Even though there's an issue remaining here, I think it's a relatively minor one that stands OK on its own, and that we can close this epic now. |
As a Chapel programmer coming from Python who's sensitive to protecting my namespaces, I would like Chapel to support an
import
statement similar to Python's and opposite to Chapel'suse
. That is, by default, no symbols would be available without full qualification by default. Thus,import M;
would be similar touse M only;
oruse M except *;
in Chapel today.The text was updated successfully, but these errors were encountered: