Re: [Python.NET] Can Python.Net inherit .Net Interface Class

Denis Akhiyarov <[email protected]>
Newsgroups gmane.comp.python.dotnet
Message-ID <CALxxJLQQp9rAkFaFDQ2wq6ddGYo2F9ygQLgDsNVi9eTmRgx+yA@mail.gmail.com>
The key is to define namespace, why is also different behavior from
ironpython:

Python 2.7.9 |Continuum Analytics, Inc.| (default, Dec 12 2014, 14:56:54)
[MSC v

.1500 32 bit (Intel)] on win32

Type "help", "copyright", "credits" or "license" for more information.

Anaconda is brought to you by Continuum Analytics.

Please check out:http://continuum.io/thanks andhttps://binstar.org

>>> import clr

Attempting to load Python.Runtime using standard binding rules...

Attempting to load Python.Runtime from:
'C:\Python\Python27\lib\site-packages\Py

thon.Runtime.dll'...

>>> import System

>>> class ViewModel(System.ComponentModel.INotifyPropertyChanged):

...   __namespace__="blabla"

...   def __init__(self):

...     pass

...

>>> ViewModel()

<__main__.ViewModel object at 0x028784B0>


On Sunday, March 13, 2016, Hansong Huang <[email protected]> wrote:

> I am attempting to implement a MVVM WPF application in Python.Net.
>
> The ViewModel class needs to implement the INotifyPropertyChanged
> interface.
>
> class ViewModel(System.ComponentModel.INotifyPropertyChanged):
>     def __init__(self):
>         pass
>
> vm = ViewModel()
>
> gives exception:
> "TypeError: interface takes exactly one argument"
>
> I am not sure what is the reason.
>
> I remember a post last year saying the the interface inheritance is
> implemented in a development brand and not integrated into main branch. not
> sure if it is the reason.
>
> I am using python 2.1.0.dev1.
>
> thanks
>
>
>
>

_________________________________________________
Python.NET mailing list - [email protected]
https://mail.python.org/mailman/listinfo/pythondotnet
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.