title: Calling super() inside a class' classmethod to get at the metaclass method
body: <p><em>Just when I though I understood metaclasses...</em></p>
  
  <p><strong>Disclaimer</strong>: I have looked around for an answer before posting, but most of the answers I have found are about calling <code>super()</code> to get at another <code>@classmethod</code> in the MRO (no metaclass involved) or, surprisingly, a lot of them were about trying to do something in <code>metaclass.__new__</code> or <code>metaclass.__call__</code> which meant the class wasn't fully created yet. I'm pretty sure (let's say 97%) that this is not one of those problems.</p>
  
  <p><br>
  <strong>Environment</strong>: Python 3.7.2</p>
  
  <p><br>
  <strong>The problem</strong>:
  I have a metaclass <code>FooMeta</code> that defines a method <code>get_foo(cls)</code>, a class <code>Foo</code> that is built from that metaclass (so an instance of <code>FooMeta</code>) and has a <code>@classmethod</code> <code>get_bar(cls)</code>. Then another class <code>Foo2</code> that inherits from <code>Foo</code>. In <code>Foo2</code>, I subclass <code>get_foo</code> by declaring it a <code>@classmethod</code> and calling <code>super()</code>. This fails miserably...</p>
  
  <p>i.e. with this code</p>
  
  <pre class="lang-py prettyprint-override"><code>class FooMeta(type):
      def get_foo(cls):
          return 5
  
  
  class Foo(metaclass=FooMeta):
      @classmethod
      def get_bar(cls):
          return 3
  
  
  print(Foo.get_foo)
  # &gt;&gt;&gt; &lt;bound method FooMeta.get_foo of &lt;class '__main__.Foo'&gt;&gt;
  print(Foo.get_bar)
  # &gt;&gt;&gt; &lt;bound method Foo.get_bar of &lt;class '__main__.Foo'&gt;&gt;
  
  
  class Foo2(Foo):
      @classmethod
      def get_foo(cls):
          print(cls.__mro__)
          # &gt;&gt;&gt; (&lt;class '__main__.Foo2'&gt;, &lt;class '__main__.Foo'&gt;, &lt;class 'object'&gt;)
          return super().get_foo()
  
      @classmethod
      def get_bar(cls):
          return super().get_bar()
  
  
  print(Foo2().get_bar())
  # &gt;&gt;&gt; 3
  print(Foo2().get_foo())
  # &gt;&gt;&gt; AttributeError: 'super' object has no attribute 'get_foo'
  </code></pre>
  
  <p><br></p>
  
  <p><strong>The question</strong>:
  So with my class being an instance of the metaclass, and having verified that both class methods exist on the class <code>Foo</code>, why aren't both calls to the <code>super().get_***()</code> working inside <code>Foo2</code>? <strong>What am I not understanding about metaclasses or <code>super()</code> that's preventing me from finding these results logical?</strong></p>
  
  <p>EDIT: Further testing shows that the methods on <code>Foo2</code> being class methods or instance methods doesn't change the result.</p>
  
  <p>EDIT 2: Thanks to @chepner's answer, I think the problem was that <code>super()</code> was returning a super object representing <code>Foo</code> (this is verified with <code>super().__thisclass__</code>) and I was expecting <code>super().get_foo()</code> to behave (maybe even to call) <code>get_attr(Foo, 'get_foo')</code> behind the scene. It seems that it isn't... I'm still wondering why, but it is getting clearer :)</p>