>>>>> "GvR" == Guido van Rossum <guido@digicool.com> writes: GvR> The question is, should we bother to make the code robust GvR> under releases with -kv or not? Yes. GvR> I used to write code that dealt with the fact that GvR> __version__ could be either "$Release: 1.9$" or "1.9", but GvR> clearly that bit of arcane knowledge got lost. Time to re-educate then! On the one hand, I personally try to avoid assigning __version__ from a CVS revision number because I'm usually interested in a more confederated release. I.e. mimelib 0.2 as opposed to mimelib/mimelib/__init__.py revision 1.4. If you want the CVS revision of the file to be visible in the file, use a different global variable, or stick it in a comment and don't worry about sucking out just the numbers. OTOH, I understand this is a convenient way to not have to munge version numbers so lots of people do it (I guess). Oh, I see there are other followups to this thread, so I'll shut up now. I think Guido's split() idiom is the Right Thing To Do; it works with branch CVS numbers too: >>> "$Revision: 1.9.4.2 $".split()[-2:][0] '1.9.4.2' >>> "1.9.4.2".split()[-2:][0] '1.9.4.2' -Barry
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4