Is there any way to find out which python versions are supported by my code?

You may know a Windows compliance tool that helps people find out if their code is supported by any version of MS.

I am looking at something similar to Python.

I am writing lib with Python 2.6, and I realized that it is not compatible with Python 2.5 due to the use of the keyword.

I would like to know if there is a simple and automatic way to avoid this situation in the future.

I'm also interested in something similar to know which OS is supported.

thanks for the help

+3
source share
3 answers

pyqver. - , , !

+7

, .

, Python , . httplib: , , str. Python 2.6 ( > 1GB ), , Python 2.5 .

, , Python X.Y.

$ python2.6 tests/run_all.py
.................................
33 tests passed
[OK]

Python 2.6.

$ python2.4 tests/run_all.py
...........EEE.........EEE.......
27 tests passed, 6 errors
[FAIL]

Python 2.4.

+6

Python 2.5 can still be saved since it can use the keyword:

from __future__ import with_statement
0
source

Source: https://habr.com/ru/post/1712439/


All Articles