title: Make function definition in a python file order independent
body: <p>I use Python CGI.  I cannot call a function before it is defined.</p>
  
  <p>In Oracle PL/SQL there was this trick of "forward declaration": naming all the functions on top so the order of defining doesn't matter.</p>
  
  <p>Is there such a trick in Python as well?</p>
  
  <p>example:</p>
  
  <pre><code>def do_something(ds_parameter):
      helper_function(ds_parameter)
      ....
  
  def helper_function(hf_parameter):
      ....
  
  def main():
      do_something(my_value)
  
  main()
  </code></pre>
  
  <p>David is right, my example is wrong.
  What about:</p>
  
  <pre><code>&lt;start of cgi-script&gt;
  
  def do_something(ds_parameter):
      helper_function(ds_parameter) 
      .... 
  
  def print_something(): 
      do_something(my_value) 
  
  print_something() 
  
  def helper_function(hf_parameter): 
      .... 
  
  def main()
      ....
  
  main()
  </code></pre>
  
  <p>Can I "forward declare" the functions at the top of the script? </p>