[IronPython] .Net assembly expects array object, sees list

Hank Fay hank at prosysplus.com
Tue May 18 17:48:26 CEST 2010


Super!  Thanks.  Works.

Hank

On Tue, May 18, 2010 at 12:14 AM, Jimmy Schementi <
Jimmy.Schementi at microsoft.com> wrote:

> It’s a feature; the IronPython .Net integration docs show how to go between
> Python lists and .NET arrays (
> http://ironpython.net/documentation/dotnet/dotnet.html#net-arrays):
>
>
>
> System.Array[int]([1, 2, 3])
>
>
>
> Basically you have to be very explicit about providing actual .NET types
> when they are expected.
>
>
>
> ~js
>
>
>
> *From:* users-bounces at lists.ironpython.com [mailto:
> users-bounces at lists.ironpython.com] *On Behalf Of *Hank Fay
> *Sent:* Monday, May 17, 2010 9:09 PM
> *To:* Discussion of IronPython
> *Subject:* [IronPython] .Net assembly expects array object, sees list
>
>
>
> I don't know whether this is a bug or a feature. <s>
>
>
>
> I'm using the Advantage ado.net data provider.  On the AdsExtendedReader
> object is a method to Seek a value.  The first parameter is supposed to be
> an array object, .Net type.
>
>
>
> Here's my code:
>
>
>
> _myArray = ["dProd"]
>
> _ok = loReader.Seek(_myArray,AdsExtendedReader.SeekType.HardSeek)
>
>
>
> and here is the result (in 2.6.1003.1), run in SharpDevelop:
>
>
>
> Microsoft.Scripting.ArgumentTypeException: expected Array[object], got list
>
>    at Caller.Call
>
>    at
> BuiltinFunctionCaller<System.__Canon,System.__Canon,System.__Canon,System.__Canon,System.__Canon,System.Int32>.Call5
>
>    at System.Dynamic.UpdateDelegates.UpdateAndExecute7
>
>    at IronPython.Runtime.Importer.Import
>
>    at IronPython.Runtime.Operations.PythonOps.InitializeModule
>
>    at PythonMain.Main
>
>
>
> TIA,
>
>
>
> Hank Fay
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100518/f04ae1d3/attachment.html>


More information about the Ironpython-users mailing list