Decoupling the version of the file from the name of the module.

Kirk McDonald mooquack at
Sat Jan 28 17:08:40 EST 2006

bobueland at wrote:
> I'm a newbie experimenting with Python. I want to incrementally develop
> a module called 'circle'. The problem is now that the file name is used
> for two purposes. To keep track of the version number and as the name
> for the module. So when I develop the first version of my file I have
> to call it The name of the module then automatically
> becomes circle_a. But when I develop the next increment and call my
> file the module name changes as well.
> Basically I want to decouple the version of my file from the name of
> the module.
> Is there a *simple* way out of this dilemma.

I would recommend just naming the file, and defining something 
like a variable named __version__ or maybe __revision__ at the top of 
the module. Then you can, I don't know, back up your old versions to 
other filenames or something.

Or, if you really want to do this right, you could install Subversion. :-)

-Kirk McDonald

More information about the Python-list mailing list