Yes please!<br><br><div class="gmail_quote">2011/1/7 Barton <span dir="ltr">&lt;<a href="mailto:barton@bcdesignswell.com">barton@bcdesignswell.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


  
    
    
  
  <div bgcolor="#ffffff" text="#000000">
    I&#39;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.<br>
    -Barton<div><div></div><div class="h5"><br>
    <br>
    On 1/6/2011 6:59 AM, Oleksii Bidiuk wrote:
    </div></div><blockquote type="cite"><div><div></div><div class="h5">
      <div class="gmail_quote">Hi Alla,
        <div><br>
        </div>
        <div>thanks for your prompt repsonse. In Python terms
          String(&#39;A&#39;) 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.<br>
          <br>
        </div>
        <div>With the example below using the .NET 2.0 version I get</div>
        <div><br>
        </div>
        <div>
          <div>
            <div>&gt;&gt;&gt; s = String.__overloads__[Char, Int32](&#39;A&#39;,
              10)</div>
          </div>
          <div>Traceback (most recent call last):</div>
          <div>
              File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;</div>
          <div>AttributeError: type object &#39;String&#39; has no attribute
            &#39;__overloads__&#39;</div>
        </div>
        <div><br>
        </div>
        <div>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.</div>
        <div><br>
          <div class="gmail_quote">2011/1/6 Alla Gofman <span dir="ltr">&lt;<a href="mailto:Alla.Gofman@sandisk.com" target="_blank">Alla.Gofman@sandisk.com</a>&gt;</span>
            <div>
              <div><br>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
                  <div link="blue" vlink="purple" lang="EN-US">
                    <div>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Hi Oleksii,</span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I have no experience
                          with importing .net modules into Python.</span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I work on embedding
                          Python into C#.</span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">There is no such
                          constructor</span> String(&#39;A&#39;)<span style="font-size: 11pt; color: rgb(31, 73, 125);"> for String class as you use, which
                          gets char.</span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">You can see which
                          constructors exists in:
                          <a href="http://msdn.microsoft.com/en-us/library/system.string.string.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/system.string.string.aspx</a></span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Example:</span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I read in
                          <a href="http://pythonnet.sourceforge.net/readme.html" target="_blank">http://pythonnet.sourceforge.net/readme.html</a></span></p>
                      <p class="MsoNormal" style="line-height: 16pt;">
                        <span style="font-size: 8pt; font-family: &quot;Georgia&quot;,&quot;serif&quot;; color: rgb(85, 87, 83);">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 &quot;__overloads__&quot;
                          attribute on a class: </span></p>
                      <div style="border: 1pt solid rgb(85, 87, 83); padding: 5pt 2pt; background: none repeat scroll 0% 0% rgb(239, 239, 255);">
                        <p class="MsoNormal" style="line-height: 16pt; background: none repeat scroll 0% 0% rgb(239, 239, 255); border: medium none; padding: 0in;">
                          <span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 68);">    from System import String, Char,
                            Int32</span></p>
                        <p class="MsoNormal" style="line-height: 16pt; background: none repeat scroll 0% 0% rgb(239, 239, 255); border: medium none; padding: 0in;">
                          <span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 68);"> </span></p>
                        <p class="MsoNormal" style="line-height: 16pt; background: none repeat scroll 0% 0% rgb(239, 239, 255); border: medium none; padding: 0in;">
                          <span style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 68);">    s = String.__overloads__[Char,
                            Int32](&#39;A&#39;, 10)</span></p>
                      </div>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I hope you succeed,</span><span style="font-size: 10pt;"></span></p>
                      <p class="MsoNormal"><span style="font-size: 1pt;"><br clear="all">
                        </span><span style="font-size: 11pt; color: rgb(31, 73, 125);"></span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Alla</span></p>
                      <p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
                      <div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;">
                        <p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;">
                            pythondotnet-bounces+alla.gofman=<a href="http://sandisk.com" target="_blank">sandisk.com</a>@<a href="http://python.org" target="_blank">python.org</a>
                            [mailto:<a href="mailto:pythondotnet-bounces%2Balla.gofman" target="_blank">pythondotnet-bounces+alla.gofman</a>=<a href="http://sandisk.com" target="_blank">sandisk.com</a>@<a href="http://python.org" target="_blank">python.org</a>]
                            <b>On Behalf Of </b>Oleksii Bidiuk<br>
                            <b>Sent:</b> Thursday, January 06, 2011 4:27
                            PM<br>
                            <b>To:</b> <a href="mailto:pythondotnet@python.org" target="_blank">pythondotnet@python.org</a><br>
                            <b>Subject:</b> [Python.NET] PythonNET 2.0
                            Alpha2 and .NET 4.0</span></p>
                      </div>
                      <div>
                        <div>
                          <p class="MsoNormal"> </p>
                          <p class="MsoNormal">Hi,</p>
                          <div>
                            <p class="MsoNormal"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal">I am trying to use
                              Python for .NET under VS2010 and .NET 4.0.
                              I&#39;ve downloaded
                              the pythonnet-2.0-alpha2.zip and changed
                              the project settings to use .NET 4.0 under
                              VS2010 and recompiled everything. The
                              resulting python.exe can be run, and
                              statements like &quot;import clr&quot; and &quot;from
                              System import String&quot; work (as the Python
                              standard library calls as well) until I
                              try to instantiate a class as e.g. </p>
                          </div>
                          <div>
                            <p class="MsoNormal"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal">s = String(&#39;A&#39;)<br clear="all">
                            </p>
                          </div>
                          <div>
                            <p class="MsoNormal">At this moment the
                              Python for .NET seem to crash in
                              nativecall.cs at NativeCall.Call_3() at
                              (the only) line</p>
                          </div>
                          <div>
                            <p class="MsoNormal"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal">return Impl.Call_3(fp,
                              a1, a2, a3);</p>
                          </div>
                          <div>
                            <p class="MsoNormal"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal">with dreaded &quot;Exception
                              of type &#39;System.ExecutionEngineException&#39;
                              was thrown.&quot;. Trying to instantiate
                              Int32() object results in &quot;Attempted to
                              read or write protected memory. This is
                              often an indication that other memory is
                              corrupt.&quot;</p>
                          </div>
                          <div>
                            <p class="MsoNormal"> </p>
                          </div>
                          <div>
                            <p class="MsoNormal">Suggestions are more
                              than welcome! Thanks in advance!<br>
                              -- <br>
                              oleksii</p>
                          </div>
                        </div>
                      </div>
                    </div>
                    <br>
                    <hr>
                    <font color="Gray" face="Arial" size="2">PLEASE
                      NOTE: The information contained in this electronic
                      mail message is intended only for the use of the
                      designated recipient(s) named above. If the reader
                      of this message is not the intended recipient, you
                      are hereby notified that you have received this
                      message in error and that any review,
                      dissemination, distribution, or copying of this
                      message is strictly prohibited. If you have
                      received this communication in error, please
                      notify the sender by telephone or e-mail (as shown
                      above) immediately and destroy any and all copies
                      of this message in your possession (whether hard
                      copies or electronically stored copies).<br>
                      <br>
                    </font>
                  </div>
                </blockquote>
              </div>
            </div>
          </div>
          <br>
          <br clear="all">
          <br>
          -- <br>
          oleksii<br>
        </div>
      </div>
      <br>
      <br clear="all">
      <br>
      -- <br>
      oleksii<br>
      </div></div><pre><fieldset></fieldset>
_________________________________________________
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">PythonDotNet@python.org</a>
<a href="http://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">http://mail.python.org/mailman/listinfo/pythondotnet</a></pre>
    </blockquote>
  </div>

</blockquote></div><br><br clear="all"><br>-- <br>oleksii<br>