I have C# code that looks like this:
dynamic dynObj = GetObjectFromPython();
CallSiteBinder binder = new MyInvokeMemberBinder("foo", false, new CallInfo(0));
CallSite<...> site = CallSite<...>.Create(binder);
object result = site.Target(site, dynObj);
MyInvokeMemberBinder is derived from InovkeMemberBinder. And method foo is defined in the Python class of which dynObj is an instance.
When I run the code, I see that IronPython calls the FallbackInvoke method of MyInvokeMemberBinder. I traced the code but couldn't figure out why IronPython calls the binder when it tries to bind the method 'foo' on the dynObj object. The call stack is like
My understanding is dynObj is a MO that knows how to do its late binding. Why does the late binding process need to fall back to the binder? And what should the binder do in this case? Thanks!