The version number encoded as a single integer. This is guaranteed to increase with each version, including proper support for non-production releases. For example, to test that the Python interpreter is at least version 1.5.2, use:
sys.hexversion
if sys.hexversion >= 0x010502F0:
use some advanced feature
...
else:
use an alternative implementation or warn the user
...