Python method defaults based off of class __init__ args
<p>I want my methods defaults within a class to be set to what was passed in through the <code>__init__</code> method. Something like this:</p>

<pre><code>class Foo(object):

    def __init__(self, loc=None):
        self.loc = loc

    def test(self, loc=self.loc):
        print loc


test = Foo()
test.test()
&gt;&gt;&gt; None

test = Foo('foobar')
test.test()
&gt;&gt;&gt; foobar
</code></pre>

<p>Is this possible or another way of achieving this?</p>

<p>EDIT: I know this current code is not possible but something that would function like this is what I'm looking for.</p>

<p>Thanks</p>
