title: Can function pointers access data outside their scope?
body: <p>I am currently learning Python pointers and I am having trouble wrapping my head around them. Let's say that you have a function that creates other functions like this:</p>
  <pre><code>def create_function(data):
      def new_function(other_data):
          if data.member == 0:
              other_data.member += 1
      return new_function
  
  test_func = create_function(object)
  </code></pre>
  <p>How would this work, since the function pointer is only able to access the data while inside the scope of create_function()? Is it only callable within the context of the containing function, or does the function object keep a reference to this data?</p>