Though this is probably far too late, there is a slightly simpler alternative to the previous answer:
__version_info__ = ('1', '2', '3')
__version__ = '.'.join(__version_info__)
(And it would be fairly simple to convert auto-incrementing portions of version numbers to a string using str()
.)
Of course, from what I've seen, people tend to use something like the previously-mentioned version when using __version_info__
, and as such store it as a tuple of ints; however, I don't quite see the point in doing so, as I doubt there are situations where you would perform mathematical operations such as addition and subtraction on portions of version numbers for any purpose besides curiosity or auto-incrementation (and even then, int()
and str()
can be used fairly easily), and comparison operations can be performed just as easily on string numerals as on integers. (On the other hand, there is the possibility of someone else's code expecting a numerical tuple rather than a string tuple and thus failing.)
This is, of course, my own view, and I would gladly like others' input on using a numerical tuple.