Greetings,

   Why 66.6 cannot be converted to System.Int32 ?

   Thanks,

   PhiHo

a
[333, 1234.5, 1, 333, -1, 66.6]
a.sort()
System.InvalidOperationException: Failed to compare two elements in the
array. -
--> System.Exception: can't convert 66.6 to System.Int32
at IronPython.Objects.Ops.ConvertTo(Object o, Type toType)
at IronPython.Objects.Ops.Compare(Object x, Object y)
at IronPython.Objects.List.DefaultPythonComparer.Compare(Object x, Object y)
at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)
--- End of inner exception stack trace ---
at System.Array.SorterObjectArray.QuickSort(Int32 left, Int32 right)
at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length,
IComparer comparer)
at IronPython.Objects.List.sort()
at ReflectOpt.IronPython.Objects.List.sort(Object )
at IronPython.Objects.BuiltinFunction.Call(Object arg0)
at IronPython.Objects.Ops.Call(Object func, Object arg0)
at IronPython.Objects.Method.Call()
at IronPython.Objects.Ops.Call(Object func)
at input_114.Run(Frame frame)
at IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame)
at IronPython.Hosting.PythonEngine.RunInteractive()


_______________________________________________ users-ironpython.com mailing list users-ironpython.com@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to