title: Functions with dependencies passed as parameters
body: <p>I'm working on a project where I'm batch generating XML files which can import to the IDE of an industrial touchscreen.</p>
  
  <p>Each XML file represents a screen, and most screens require the same functions and the process for dealing with them is the same, with the exception of the fact that each screen type has a unique configuration function.</p>
  
  <p>I'm using a <code>ScreenType</code> class to hold attributes specific to a screen type, so I decided to write a unique configuration for each type, and pass it as a parameter to the <code>__init__()</code> of this class. This way, when I pass around my <code>ScreenType</code> as it is needed, it's configuration function will stay bundled and can be used whenever needed. </p>
  
  <p>But I'm not sure what will happen if my configuration function itself has a dependency. For example:</p>
  
  <pre><code>def configure_inputdiag(a, b, c):
      numerical_formatting = get_numerics(a)
      # ...
      return configured_object
  </code></pre>
  
  <p>Then, when it comes time to create an instance of a <code>ScreenType</code></p>
  
  <pre><code>myscreentype = ScreenType(foo, man, shoe, configure_inputdiag)
  </code></pre>
  
  <p><code>get_numerics</code> is a module scoped function, but <code>myscreentype</code> could (and does) get passed within other modules. </p>
  
  <p>Does this create a problem with dependencies? I'd try to test it myself, but it seems like I don't have a fundamental understanding behind what's going on when I pass a function as a parameter. I don't want to draw incorrect conclusions about what's happening.</p>
  
  <p>What I've tried: Googling, Search SO, and I didn't find anything specifically for Python.</p>
  
  <p>Thanks in advance.</p>