title: Why can't I pass self as a named argument to an instance method in Python?
body: <p>This works:</p>
  
  <pre><code>&gt;&gt;&gt; def bar(x, y):
  ...     print x, y
  ...
  &gt;&gt;&gt; bar(y=3, x=1)
  1 3
  </code></pre>
  
  <p>And this works:</p>
  
  <pre><code>&gt;&gt;&gt; class Foo(object):
  ...     def bar(self, x, y):
  ...             print x, y
  ...
  &gt;&gt;&gt; z = Foo()
  &gt;&gt;&gt; z.bar(y=3, x=1)
  1 3
  </code></pre>
  
  <p>And even this works:</p>
  
  <pre><code>&gt;&gt;&gt; Foo.bar(z, y=3, x=1)
  1 3
  </code></pre>
  
  <p>But why doesn't this work in Python 2.x?</p>
  
  <pre><code>&gt;&gt;&gt; Foo.bar(self=z, y=3, x=1)
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: unbound method bar() must be called with Foo instance as first argument (got nothing instead)
  </code></pre>
  
  <p>This makes metaprogramming more difficult, because it requires special case handling. I'm curious if it's somehow necessary by Python's semantics or just an artifact of implementation.</p>