Is this just for readability to the developer? python

Peter Hansen peter at engcorp.com
Wed Jun 2 15:54:18 CEST 2004


David Stockwell wrote:
> I was looking through some of our source code and I found this:
> 
> initModule( "$Revision: 3.1 $".split(" ")[1] )
> 
> In this example, it looks like only the '3.1' is actually passed to the 
> function.  Which leads me to speculate that the rest of it is just there 
> to make it easier for the developer when looking at source code to see 
> what version of the module is being used.

Revision control systems such as CVS and Subversion know how to
find and update information such as the revision tag when it is
formatted in that manner (leading/trailing $ etc).  The programmer
also apparently thought it would be a good idea to use the revision
number programmatically, which explains the surrounding split()
and indexing operations, and the function call.

-Peter



More information about the Python-list mailing list