The reason, I think this is important, is that in Python developers will avoid explicit typed of arrays in favor of loose typed lists because its more Pythonic. Since interaction with general purpose languages (strongly typed) will require more strict typing, the interpreter or compiler should make that transformation (from List to array of doubles) implicitly, or if it can't be done throw an exception. Otherwise, you are forcing IronPython developers to adhere to strict typing whenever they script interactions of objects defined by general purpose languages like C#.
richard
On Apr 19, 2005, at 6:36 PM, Martin Maly wrote:
error message.John A. Tenney Wrote:
1. I'd like to pass an array of 6 doubles to a method, but get andouble array.For example, the "myMethod" call below fails when it requires aarray=[1, 2, 3.5, 4] myObject.myMethod(array)
If you create the array using the syntax above, you end up with object of type list. To create .Net array, you can do the following:
import System array = System.Array.CreateInstance(System.Double, 5) array[0]=1.3 arraySystem.Double[](1.3, 0, 0, 0, 0)
And call:
myObject.MyMethod(array)
_______________________________________________ users-ironpython.com mailing list users-ironpython.com@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com