-
Notifications
You must be signed in to change notification settings - Fork 49
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
Option to import all functions from a script without @export
decorator
#207
Comments
I’d love to implement this (and seriously thought about how before the 1.0 release) but I just can’t think of a way to do this without major issues. If somebody can find a way, or can convince me that the options below are feasible, I’m happy to implement this.
Even if the above could be solved there’d be another issue since scripts might be doing things that modules mustn’t do, such as calling |
Thanks @klmr , it would be indeed very cool to have this feature available in (1) I actually see no big problem in it, I kind of like it to have a separate function only for scripts ('legacy modules'), it makes clearer to the user what it is being imported and how. (2) I don't know either... (3) I agree. It defeats the purpose but can be useful, at least better than having to add all the decorators one by one. (4)/(5) To keep (6) Thinking about the future, a killer feature would be to use the same "file extension cue method" to import Python scripts via
Other difficult task, however If you could select the importation of only user-defined functions from the script (which is usually the main interest), most of that issues would go away, wouldn't? Since following good practices they should not contain |
Another alternative that was originally considered but rejected, but to which I’m starting to come around:
Unfortunately this would be a breaking change. But I don’t judge the impact as severe, so I’m not averse to introducing this change in a minor release. 1 In particular, intercepting |
Hey @klmr , this package is really fantastic, I'm starting to use it everywhere.
I'd like to know if it is possible to import all functions from a script without the need to decorate each one with
#' @export
. That would be very helpful because it would allow us to import any existing script as a module.Thank you
The text was updated successfully, but these errors were encountered: