How to track class version numbers
<p>I have a file (call it munging.py) containing multiple functions and classes that all apply to munging data into a standardized format.  I generally do not make substantial changes to this file, or the classes, but now and then a major change is needed.  Suppose the file has the following contents: </p>

<pre><code>def function_1()
    '''common function for all classes'''

def function_2()
    '''another common function'''

class_1()
    def __init__()

class_2()
    def __init__()
</code></pre>

<p>When I update "munging.py" I want to keep a record of the last version, but I do not want to increment a version number in the file name to keep track of this (e.g. I can rename munging.py to munging_v1.py, munging_v2.py, but I would rather not have to change all of my scripts to load munging_v2 instead of munging_v1).</p>

<p>I suppose another option is to not change the file name, instead only change the class names (e.g. class_1_v1, class_1_v2, etc.), but I run into the same problem of changing the class call in all of my dependent scripts.  </p>

<p>Bear in mind that I have no formal programming training, so I may be asking an overly simple question.  Is there a simple, or standard, or intuitive way to keep a record of all my previous class/script versions while implementing the newest version when called?  Is this where svn, etc. come to play?</p>

<p>For versioning the code, you do not need to make any change in code. Use any version control tool like <code>git</code> or <code>mercurial</code>. These are open-source and you can use it for free.</p>

<p>Use below links to download any of them:</p>

<ul>
<li><a href="https://git-scm.com/downloads" rel="nofollow">Git</a></li>
<li><a href="https://www.mercurial-scm.org/wiki/Download" rel="nofollow">Mercurial</a></li>
</ul>

python version