title: SystemError is raised after attempt to create function with positional-only args in runtime inside other one
body: <p>There is some test code:</p>
  
  <pre><code>some_type = int
  
  def func0():
      def func1(arg: some_type, /):
          pass
  
  func0()
  </code></pre>
  
  <p>And I get the following error:</p>
  
  <pre><code>Traceback (most recent call last): 
  ...
  SystemError: no locals when loading 'some_type'
  </code></pre>
  
  <p>However the code below works as expected:</p>
  
  <pre><code>some_type = int
  
  def func0():
      def func1(arg: some_type):
          pass
  
  func0()
  </code></pre>
  
  <p>And this one is also valid:</p>
  
  <pre><code>some_type = int
  exec('''
  def func1(arg: some_type, /):
      pass
  ''')
  </code></pre>
  
  <p>I know that annotations will no longer be evaluated at definition time in future versions; also it is possible to activate such behaviour in 3.7+ versions. Something like</p>
  
  <pre><code>from __future__ import annotations
  some_type = int
  
  def func0():
      def func1(arg: some_type, /):
          pass
  
  func0()
  </code></pre>
  
  <p>has no problems as well. However, the question is about the current strange behaviour at function definition time. <code>some_type</code> is in no way a local variable of <code>func0</code>, though python thinks so. One more fine version:</p>
  
  <pre><code>def func0():
      some_type = int
      def func1(arg: some_type, /):
          pass
  
  func0()
  </code></pre>
  
  <p>I've read <a href="https://www.python.org/dev/peps/pep-0570/" rel="nofollow noreferrer">PEP 570</a> but not found anything about annotations declarations there.</p>
  
  <p>My python version:</p>
  
  <pre><code>sys.version_info(major=3, minor=8, micro=0, releaselevel='final', serial=0)
  </code></pre>