-
Notifications
You must be signed in to change notification settings - Fork 167
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
Importing modules does not work inside the function #1317
Comments
We have two options:
The second approach is more general, it would allow to treat modules as symbols / variables. Not sure if we need it or not. We need this in LFortran too to implement j3-fortran/fortran_proposals#1, so we should do a good design. @czgdp1807 what is your opinion? |
Regarding priorities, this is nice to have, but not critical, as we can simply import the symbols directly for now. |
Oh yes. I am |
I would work on this later, I think first we should implement more examples, such as making mathfn much more complex and see what else is missing. Then we can do this one in a more natural manner. |
This issue is fixed (#1323), I think. $ cat integration_tests/test_import_01.py
import test_import
def test():
print(test_import.print_a())
print(test_import.print_b())
print(test_import.print_c())
test()
$ lpython integration_tests/test_import_01.py
A
B
C |
I came across another issue that doesn't work yet. Like for this example:
Error:
I will try to work on this later this week. After that, I think we are ready to start making python packages.
Originally posted by @Thirumalai-Shaktivel in #1305 (comment)
The text was updated successfully, but these errors were encountered: