[Python.NET] Fwd: PythonNET 2.0 Alpha2 and .NET 4.0

Barton barton at BCDesignsWell.com
Sun Jan 16 21:32:10 CET 2011


This has been pushed to the trunk @ version 122 on the 9th of January, 2011.
See the Tracker/Patches for details.

On 1/11/2011 6:17 AM, Oleksii Bidiuk wrote:
> Hi Barton,
>
> do you still have any plans to work on the merge? I am curious what 
> the changes are (how much, what impact do they have) and whether there 
> something can be done to help you with this.
>
> Thanks in advance!
>
> 2011/1/7 Barton <barton at bcdesignswell.com 
> <mailto:barton at bcdesignswell.com>>
>
>     I've got this working on my private (for the moment) branch.  I
>     could do this merge by this weekend if folks will find it useful.
>     -Barton
>
>
>     On 1/6/2011 6:59 AM, Oleksii Bidiuk wrote:
>>     Hi Alla,
>>
>>     thanks for your prompt repsonse. In Python terms String('A')
>>     means constructor with a string parameter AFAIK. When I use the
>>     python.exe build against CLR 2.0
>>     (from pythonnet-2.0-alpha2-clr2.0_115_py26.zip) it works, but
>>     then it talks against .NET 2.0 while I want to talk to the same
>>     4.0 version as my .NET application.
>>
>>     With the example below using the .NET 2.0 version I get
>>
>>     >>> s = String.__overloads__[Char, Int32]('A', 10)
>>     Traceback (most recent call last):
>>       File "<stdin>", line 1, in <module>
>>     AttributeError: type object 'String' has no attribute '__overloads__'
>>
>>     Basically it seems that the version of python for .net compiled
>>     against .NET 4.0 runtime does not work out of box for me. I
>>     wonder if somebody had more luck with this.
>>
>>     2011/1/6 Alla Gofman <Alla.Gofman at sandisk.com
>>     <mailto:Alla.Gofman at sandisk.com>>
>>
>>         Hi Oleksii,
>>
>>         I have no experience with importing .net modules into Python.
>>
>>         I work on embedding Python into C#.
>>
>>         There is no such constructor String('A')for String class as
>>         you use, which gets char.
>>
>>         You can see which constructors exists in:
>>         http://msdn.microsoft.com/en-us/library/system.string.string.aspx
>>
>>         Example:
>>
>>         I read in http://pythonnet.sourceforge.net/readme.html
>>
>>         In most cases, Python for .NET can determine the correct
>>         constructor to call automatically based on the arguments. In
>>         some cases, it may be necessary to call a particular
>>         overloaded constructor, which is supported by a special
>>         "__overloads__" attribute on a class:
>>
>>             from System import String, Char, Int32
>>
>>             s = String.__overloads__[Char, Int32]('A', 10)
>>
>>         I hope you succeed,
>>
>>
>>         Alla
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20110116/30b72111/attachment.html>


More information about the PythonDotNet mailing list