-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
API: Environment: create_environment is not deterministic #1155
Comments
Yeah. I agree. I actually thought about the fact that this was not the best idea (to have an argument that does multiple things) and now we're stuck in that mess. I should have reacted then and there, but now it's kind of too late. I guess we should just add a new function Not sure what the best move is in terms of naming, but I'm sure that we want to move away from the status quo. |
Sorry, that's my fault. I think the function should be deprecated in favor of two new functions |
@micbou No problem. I didn't really spot it either. |
Cannot we use new kwargs for it?
|
I just realized again that it's not as bad as I thought it was originally. I thought it would also resolve stuff like So it's actually better than I thought. I think this is deterministic, because it will behave just fine for the user. It might even benefit users, because they usually don't care about the I agree that it's maybe not ideal and ambiguities are generally not that cool, but it's also really practical for a lot of users. |
Yes, for the end user it is good, but I came across it when using it in jedi-vim (where I then just used |
Thanks for clarifying. I really think that it's fine for now. Let me know if it's a bigger issue or you think that it's something we should rethink. |
There is no recommended API to explicitly create an Environment from an executable.
create_environment
currently falls back to based on if something is a file:This means that the caller needs to do the same check before to ensure that
path
is treated at the executable.I suggest that either only executables are supported, or kwargs (executable, path) get used, or distinct functions should be created.
As for jedi-vim I can use
Environment()
directly - but its docstring explicitly states that it should not be used directly:(I am refactoring the environments currently - on top of #1108)
Related comment there: #1108 (comment)
The text was updated successfully, but these errors were encountered: