title: I'm trying to call function Msg() from function int_err() and int_err() from Msg()
body: <p>I am writing an Error class (class stuff left out for clarity).  It needs to be able to issue error messages when it is called with bad parameters.  I use a <code>Msg()</code> function to hold all the machinery used to process messages (e.g. determine if a message is so severe as to cause termination and to maintain error counts).</p>
  <pre><code>def Msg(level, text)
      print('level' + '-' + text)
      if level == 'unknown':
          int_err(text)
      # ...
  def info(text)
      # ...
      Msg('info', text)
  def warn(text)
      # ...
      Msg('warn', text)
  # . . .
  def int_err(text)
      Msg('internal error', text)
      # ...
  
  info('informational')
  warn('warning')
  Msg('unknown', 'erroneous call')
  </code></pre>
  <p>This fails because <code>int_err()</code> is not defined when it is called from <code>Msg()</code>.  If I move <code>def int_err()</code> above <code>def Msg()</code> then <code>Msg()</code> is not defined when called from <code>int_err()</code>.</p>