How do I refactor 100s of Class Methods in Python?
<p>I am working on some legacy code (created by someone in love with spaghetti code) that has over 150 getters and over 150 setters. The getters look like this:</p>

<pre><code>def GetLoadFee(self):
    r_str = ""
    if len(self._LoadFee) &gt; 20:
        r_str = self._LoadFee[:20]
    else:
        r_str = self._LoadFee.strip()
    return r_str.strip()

def GetCurrency(self):
    r_str = ""
    if len(self._Currency) &gt; 3:
        r_str = self._Currency[:3]
    else:
        r_str = self._Currency.strip()
    return r_str.strip()
</code></pre>

<p>I would love to take the contents of each of these Getters and put them into a decorator /closure or some other method to make this code easier to maintain. The Setters are all one liners, so they're not as important. But they are basically all the same too. Any ideas to make this less painful?</p>

<p>NOTE: I still need the original Getter names as they are used in other programs as this nasty script is used in lots of other legacy code.</p>
