title: Assigning an IronPython method to a C# delegate
body: <p>I have a C# class that looks a little like:</p>
  
  <pre><code>public class MyClass
  {
      private Func&lt;IDataCource, object&gt; processMethod = (ds) =&gt;
                                                            {
                                                              //default method for the class
                                                            }
  
      public Func&lt;IDataCource, object&gt; ProcessMethod
      {
          get{ return processMethod; }
          set{ processMethod = value; }
      }
  
      /* Other details elided */
  }
  </code></pre>
  
  <p>And I have an IronPython script that gets run in the application that looks like</p>
  
  <pre><code>from MyApp import myObj #instance of MyClass
  
  def OtherMethod(ds):
      if ds.Data.Length &gt; 0 :
          quot = sum(ds.Data.Real)/sum(ds.Data.Imag)
          return quot
      return 0.0
  
  myObj.ProcessMethod = OtherMethod
  </code></pre>
  
  <p>But when <code>ProcessMethod</code> gets called (outside of IronPython), after this assignment, the default method is run.</p>
  
  <p>I know the script is run because other parts of the script work.</p>
  
  <p>How should I be doing this?</p>