I have a list comprehension operating on elements of an .NET array like
obj.arr = [f(x) for x in obj.arr]
However the assignment back to obj.arr fails.
Is it possible to convert a list to a .NET array in IronPython?
Try this:
obj.arr = Array[T]([f(x) for x in obj.arr])
replacing T with type of array elements.
Alternatively:
obj.arr = tuple([f(x) for x in obj.arr])