<div dir="ltr"><div><b>Hi Hansong, </b><br></div><div><br></div>I noticed that you (@hhspiny) released your WPF adventures with pythonnet on github, but without a license: <div><br></div><div><a href="https://github.com/hhspiny/WPFPy">https://github.com/hhspiny/WPFPy</a><br></div><div><br></div><div>Can you please indicate the license?</div><div><br></div><div><b>Hi Tony,</b></div><div><br></div><div>Please let me know how this subclassing (.NET -> Python -> Python) would work?</div><div><br></div><div><b>Thanks,</b></div><div><b>Denis</b></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 11, 2016 at 2:04 AM, Tony Roberts <span dir="ltr"><<a href="mailto:tony@pyxll.com" target="_blank">tony@pyxll.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br><br>yes, deriving from a python class in Python that itself is derived from a .net class doesn't work. Apologies, if I'd known that was what you were doing I could have saved you some time by telling you that earlier.<br><br>AFAIK this hasn't been created as an issue in github, so please if you could do that that would be helpful. It's probably not that hard to make work, but it's not something I've got time to look at myself right now I'm afraid. If anyone else wants to have a go and needs pointing in the right direction let me know.<br><br>Tony<br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 11, 2016 at 3:41 AM Hansong Huang <<a href="mailto:hhspiny@live.com" target="_blank">hhspiny@live.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Hello,<div><br></div><div>This is related to previous investigation of inheriting from .NET interface class to create WPF MVVM structure. As now I believe it has nothing to do with interface class, but instead caused by inheriting from .Net class overall. </div><div><br></div><div>please see the following code</div><div><br></div><div>import clr, System</div><div><div>class baseNA(System.Random):</div><div> __namespace__ = "BaseNA"</div><div> def __init__(self):</div><div> super(baseNA,self).__init__()</div><div># @clr.clrmethod(System.String,<wbr>[])</div><div> def ToString(self):</div><div> return "string"</div><div><br></div><div>class baseNB(baseNA):</div><div> __namespace__ = "BaseNB"</div><div> def __init__(self):</div><div> super(baseNB,self).__init__()</div><div>bna = baseNA()</div><div>print bna.ToString()</div><div>print bna._Random__ToString()</div><div>bnb = baseNB()</div><div>print bnb.ToString()</div><div>print bnb._baseNA__ToString()</div><div>print bnb._Random__ToString()</div></div><div><br></div><div><br></div><div>This produces the following output</div><div><div>string</div><div>BaseNA.baseNA</div><div>BaseNB.baseNB</div><div>BaseNB.baseNB</div><div>BaseNB.baseNB</div></div><div><br></div><div>as you see, while baseNA -- the first level inherited class works fine. ToString() overrides System.Random.ToString()</div><div><br></div><div>But baseNB inherited from baseNA did not inherit ToString() method from baseNA, but rather inherited from System.Random. </div><div><br></div><div>Not sure if it is a bug in <a href="http://python.net" target="_blank">python.net</a> or was intended. </div><div><br></div><div>regards,</div><div><br></div><div>Hansong</div><div><br></div><div><br></div><div><br></div><div><br></div> </div></div>
______________________________<wbr>___________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">PythonDotNet@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pythondotnet" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/pythondotnet</a></blockquote></div>
<br>______________________________<wbr>___________________<br>
Python.NET mailing list - <a href="mailto:PythonDotNet@python.org">PythonDotNet@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pythondotnet" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/pythondotnet</a><br></blockquote></div><br></div>