title: Calling Python functions passed by weakref
body: <p>Using Boost.Python, is there a way to call a Python function that's been passed through a <code>weakref</code>? The following code doesn't work:</p>
  
  <pre><code>import weakref
  
  def foo():
      print 'it works'
  
  def func():
      return weakref.ref(foo)
  </code></pre>
  
  <p>The following is the C++:</p>
  
  <pre><code>object module = import("test");
  object func(module.attr("func"));
  object foo = func();
  foo(); // Should print 'it works', but it prints nothing
  </code></pre>
  
  <p>However, if I pass the function object without weakref, it all works fine. Is there any way to make this work?</p>