title: Python, How to "automatically" call a function/method from an instance method?
body: <p>Is there a way to force an instance method in Python to call another method prior to executing?</p>
  
  <p>A simple example for demonstration:</p>
  
  <pre><code>class MyClass(object):
    def __init__(self):
      pass
    def initialize(self):
      print "I'm doing some initialization"
    def myfunc(self):
      print "This is myfunc()!"
  </code></pre>
  
  <p>I'd like some way to have myfunc() automatically call initialize() prior to running.  If I do:</p>
  
  <pre><code>obj = MyClass()
  obj.myfunc()
  </code></pre>
  
  <p>I'd like to see the following as the output:</p>
  
  <pre><code>I'm doing some initialization 
  This is myfunc()!
  </code></pre>
  
  <p>Without having to explicitly call initialize() within myfunc().</p>
  
  <p>The reason for this is if I have many instances of "myfunc", say myfunc1, myfunc2, myfunc3, that all need to call "initialize", I'd rather have them all call initialize once in the same place, as opposed to manually calling the method each time.  Is this something meta classes could do?</p>