My code requires Python version of 3.6 or higher. To ensure this, I use the following:
import sys
version = sys.version_info
assert version.major > 3 or (version.major == 3 and version.minor >= 6)
But this doesn't seem like the best way to do this (from a good coding practices viewpoint). Is there a better way?
What is the appropriate way to make sure your script is being run on an appropriate version of Python?