Revisiting PEP 394
Revisiting PEP 394
Posted Mar 1, 2019 8:44 UTC (Fri) by jani (subscriber, #74547)Parent article: Revisiting PEP 394
So here's an idea: Allow scripts to declare the Python versions they're compatible with using a python_requires special comment near the top of the file. The plain python shebang would be a launcher that looks at the comment, and runs the latest compatible Python version that's available, or falls back to a baseline Python version if there's no python_requires. I think the baseline could be Python 2.
PEP263 (https://www.python.org/dev/peps/pep-0263/) defines a special comment for encoding, this would be similar.
PEP440 (https://www.python.org/dev/peps/pep-0440/) defines the version identification and dependency specification.
The Python packaging user guide (https://packaging.python.org/guides/distributing-packages...) defines the python_requires for packaging.
Posted Mar 1, 2019 8:49 UTC (Fri)
by jani (subscriber, #74547)
[Link]
Posted Mar 2, 2019 22:35 UTC (Sat)
by intgr (subscriber, #39733)
[Link]
Python developers have stated on the record that breaking compatibility so harshly with Python 3 was a huge mistake and will not be repeated. If there will be a Python 4, it won't be the same kind of nightmare that Python 3 was, but will hopefully follow the usual practice of __future__ flags and deprecations announced well in advance.
> Allow scripts to declare the Python versions they're compatible with
That's already somewhat covered by the __future__ module: https://docs.python.org/3.8/library/__future__.html
Revisiting PEP 394
Revisiting PEP 394