numirias / semshi

🌈 Semantic Highlighting for Python in Neovim
1.03k stars 34 forks source link

Any plans to python 3.10 new syntax support? #121

Closed Nosterx closed 2 years ago

wookayin commented 2 years ago

I believe semshi relies on ast.parse of the neovim's host python runtime, so you should have no problem if the host python is 3.10+. But there might be some cases that still would need to be handled separately (as was the case in previous python versions). Should you run in to any 3.10+ syntax that you believe is unsupported by semshi, please report and write them more specifically.

Nosterx commented 2 years ago

Thank you for an explanation. All I actually needed to fix problems with new syntax was removing hard coded python3 host version let g:python3_host_prog = '/usr/bin/python3.8' from my init.vim file.

wookayin commented 2 years ago

Yes, it's often a good idea to set python3_host_prog dynamically depending on your current (activated) python environment, such as virtualenv or anaconda:

For example:

" in init.vim
if executable('python3')
    let g:python3_host_version = split(system("python3 --version 2>&1"))[1] 
else
    " ... some fallback behaviors
end