Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upOptionally force ropevim to use python3. #71
Conversation
A new variable 'ropevim_prefer_py3' has ben introduced. If non-zero, ropevim will run under the python3 interpreter, if it is available, even for python2 scripts. This should help reducing the use of python2-only idioms. The default value is `0`.
Python 3 strings do not need decoding, so 'decode' is not available. In python2 the call is performed to preserve the original program logic.
|
I corrected a mistake in the naming of the user-defined alias for the command for python provider and added a default value to get(b:,....). |
|
Hi I use this hack on every new install how can I help to help to merge it? :) |
|
Hi, thank you for your interest, but I think there is not much to be done in that direction: the PR has no conflict and only needs reviewing, but the project seems to be stagnating (though honestly it works quite well, so why change it?). |
|
No, I don't have a problem with it. However, I think this vim plugin has no future for me (and whole rope perhaps), because the future as I see it is in LSP (see python-rope/rope#219 (comment) ). |
|
Thank you for the answer and for suggesting an alternative. I am piqued, but at the moment changing tools is low on my priority list. I appreciate that you took the trouble of merging even though you have little interest in this right now. |
Hello, thank you very much for this plugin, I used it extensively.
The only problem it ever gave me is that, running under Python2, it does not work when using Python3-only features.
To overcome this limit I introduced a way to optionally force ropevim to use Python3 syntax via a new variable.
Personally, I set the variable globally, so that even my Python2 scripts get better forward compatibility, but it can be set local to a buffer at need or automatically via autocommand if the intended version of Python can be guessed..
In the few months I used this option I did not observe problems. When renaming variables, the refactoring is applied to f-strings too.
I submit this pull request so that my approach can be examined and tested by a wider audience, possibly integrated upstream.