title: Can I define a scope anywhere in Python?
body: <p>Sometimes I find that I have to use functions with long names such as <code>os.path.abspath</code> and <code>os.path.dirname</code> a <strong>lot</strong> in just a few lines of code. I don't think it's worth littering the global namespace with such functions, but it would be incredibly helpful to be able to define a scope around the lines where I need those functions. As an example, this would be perfect:</p>
  
  <pre><code>import os, sys
  
  closure:
      abspath = os.path.abspath
      dirname = os.path.dirname
  
      # 15 lines of heavy usage of those functions
  
  # Can't access abspath or dirname here
  </code></pre>
  
  <p>I'd love to know if this is doable somehow</p>