title: In Python, is it possible to accept a function call template as a parameter?
body: <p>As part of improving the syntax for Aspect-Oriented Programming in Python based on the excellent answer by jsbueno: <a href="https://stackoverflow.com/questions/12356713/aspect-oriented-programming-aop-in-python">Aspect oriented programming (AOP) in Python</a> , I was wondering if it's possible to accept a function template as a parameter in Python with any decoration.</p>
  
  <p>Eg, being able to call <code>foo(bar(5))</code> with <code>bar</code> undefined, and have <code>foo</code> receive an object representing the expression <code>bar(5)</code>; rather than an error that <code>bar</code> is undefined. (This would then be used as an input to construct a rule for matching incoming network messages indicating that another node has run function <code>bar</code> with parameter 5.)</p>
  
  <p>Is there any better way to do this than passing the template as a string and parsing it with <code>ast</code>?</p>