Using "self" in function arguments definition
<p>Instead of doing the following:</p>

<pre><code>def MyFunc(self, a, b, c)
    self.a = a
    self.b = b
    self.c = c
</code></pre>

<p>I want to do the following:</p>

<pre><code>def MyFunc(self, self.a, self.b, self.c)
</code></pre>

<p>Why does this not work?</p>

<p>If I have to use the first approach, is there any good way to make sure I don't unintentionally overwrite variables used elsewhere in the project with the same names (e.g. perhaps "a" is a variable used by another object).</p>

<p>Maybe the problem is related to this behaviour, which might be supprising for new pythoneers:</p>

<pre><code>class Cl():
    def MyFunction(self, a):
        self.a = a


a= {"w":"old"}
myCl = Cl()
myCl.MyFunction(a)

print a, myCl.a

a.update({"w":"new"})

print a, myCl.a
</code></pre>

<p>which outputs</p>

<pre><code>{'w': 'old'} {'w': 'old'}
{'w': 'new'} {'w': 'new'}
</code></pre>

python