<div><span class="gmail_quote">On 8/4/07, <b class="gmail_sendername">Darren Govoni</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:darren@ontrenet.com" target="_blank">darren@ontrenet.com</a>
> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div bgcolor="#ffffff">
<div><font face="Arial" size="2"> Can .NET see python defined classes or objects? I define a class in Python</font></div>
<div><font face="Arial" size="2">but one of my .NET classes tries to find it via reflection and it cannot.</font></div>
<div><font face="Arial" size="2">I saw a post about this that is over a year old saying it was not then supported.</font></div></div></blockquote>
<div> </div>
<div>The fundamental issue here is that Python classes don't follow the same semantics as CLR classes. They are, for instance, mutable after construction in ways that CLR classes are not. In order to expose a Python class directly to the CLR, it would have to be "frozen" in some manner, and you might prefer to be able to specify the types of the parameters instead of dealing with everything as "object". This would require some sort of non-Python syntax to accomplish. Fortunately, there already is such a thing: a CLR interface. Define an interface in an external assembly and you can derive from it in Python. Your CLR classes can then access the Python code through the interface.
</div>
<div> </div>
<div>--</div>
<div>Curt Hagenlocher</div>
<div><a href="mailto:curt@hagenlocher.org">curt@hagenlocher.org</a></div></div>