title: Python super in local scope
body: <p>I can't figure out why <code>super().method()</code> cannot be called from local scopes:</p>
  <p>Correct code:</p>
  <pre><code>class A:
      def method(self):
          print('hello')
  
  class B(A):
      def method(self):
          super().method()
  
  B().method()
  </code></pre>
  <p>Error:</p>
  <pre><code>class A:
      def method(self):
          print('hello')
  
  class B(A):
      def method(self):
          def f():
              super().method()
          f()
  
  B().method()
  </code></pre>
  <p>Error output:</p>
  <pre class="lang-py prettyprint-override"><code>Traceback (most recent call last):
    File &quot;D:\sample.py&quot;, line 12, in &lt;module&gt;
      B().method()
    File &quot;D:\sample.py&quot;, line 10, in method
      f()
    File &quot;D:\sample.py&quot;, line 9, in f
      super().method()
  RuntimeError: super(): no arguments
  </code></pre>