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 selective import in @py macro @py from <module> import ... #117

Closed
hhaensel opened this issue Feb 21, 2022 · 2 comments
Closed

Support selective import in @py macro @py from <module> import ... #117

hhaensel opened this issue Feb 21, 2022 · 2 comments

Comments

@hhaensel
Copy link
Contributor

Currently partial imports, e.g. @py from os.path import join as py_join are not supported.

I propose to add an additional method to @py that supports this kind of statements.
I'll submit a PR, which you might consider if you like that feature.

BTW, just recently stumbled across PythonCall in the discourse announcements. I think it is a really cool package! 🚀

@cjdoris
Copy link
Collaborator

cjdoris commented Feb 21, 2022

As mentioned in #118 this functionality exists with syntax @py import os.path: join as py_join.

@cjdoris cjdoris closed this as completed Feb 21, 2022
@hhaensel
Copy link
Contributor Author

Thanks for the feedback. I didn 't know that syntax and has just tried the simplest approach, my bad!
I like your version better than mine, it's closer to the Julia way of imports and therefore can be integrated into begin end clauses.

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

2 participants