Call a functor in Python
<p>Should be easy, but somehow I don't get it. I want to apply a given function. Background is copy a class and applying a given method on the newly created copy. </p>

<p><strong>Major Edit. Sorry for that.</strong></p>

<pre><code>   import copy
   class A:

       def foo(self,funcName):
           print 'foo'
           funcName()

       def Bar(self):
           print 'Bar'

        def copyApply(self,funcName):
           cpy = copy.copy()
           # apply funcName to cpy??

    a = A()
    func = a.Bar()
    a.foo(func) # output 'Bar'
    b = a.copyApply(foo) # new copy with applied foo
</code></pre>
