4 ms·
What is the shebang that one should use to run code that targets python3.8 on a system that only has python3.7 installed? If you use python3 it might randomly
by justinsaccount 7y ago
What is the shebang that one should use to run code that targets python3.8 on a system that only has python3.7 installed?
If you use python3 it might randomly fail, if you use python3.8 will fail with 'No such file or directory'
- EdwardDiego 7y agoYep, the latter, I'd much rather a deterministic failure. Or if you're using something like Poetry to package your code, you can specify supported versions and then users of your code will be informed if they lack that Python. But then if you're trying to write portable Python 3 code without any need for the end user to be pyenv-ing stuff, you probably don't want to be writing 3.8 - off the top of my head, Ansible, for example, targets Python 3.5 for this reason. I'm not defending this btw, modern Python development is painful, and I taught myself to code in Python, so it hurts to see my first love so. I guess it would be nice if Python came up with something like Java's source/target which errors if you're using incompatible features.