Can someone please explain this really strange observation to me?
I am trying to call Rx extension methods from within IronPython, and this is just not possible. I swallowed this to a simple example:
import clr clr.AddReference("System.Core") from System.Linq import Enumerable def process(value): return Enumerable.Select(value, lambda x:x)
In this case, we start with normal LINQ. If I call the process
function from my hosting environment using an array or any other IEnumerable
object, it works completely fine.
So, I tried to simply replace the references to using Observable
extension methods as follows:
import clr clr.AddReference("System.Reactive.Linq") from System.Reactive.Linq import Observable def process(value): return Observable.Select(value, lambda x:x)
In this case, if I call the process
function with an IObservable
object, the call crashes with an ugly error message:
expected IObservable[object], got Select[int, int]
Has anyone hit something like this? Did I miss something? Is there any special hack to make Enumerable
work with lambda delegates that is not Observable
? I must admit that I'm completely puzzled here.
By the way, just like a health check, the following example works just fine:
import clr clr.AddReference("System.Reactive.Linq") from System.Reactive.Linq import Observable def process(value): return Observable.Sum(value)
I wanted to leave it there so that it was clear that the problem was indeed in calling the Observable.Select
method.