[Python.NET] Is it possible to check if a .NET class is a subclass of another .NET class

2020-05-19 Thread robert . hoelzl
In python I can check the inheritance via isinstance() (and issubclass()).
These methods do not work on .NET classes.
Are there alternative methods which are doing the job for .NET
___
PythonNet mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pythonnet.python.org/
Member address: [email protected]


[Python.NET] Re: Is it possible to check if a .NET class is a subclass of another .NET class

2020-05-19 Thread gregor . hd
Hi, is this what you mean?

>>> import clr
>>> from System import Object
>>> from System.Collections.Generic import List
>>> List.__class__.__subclasscheck__(Object,List)
True

HTH,
Gregor


Am Mi., 20. Mai 2020 um 01:48 Uhr schrieb :

> In python I can check the inheritance via isinstance() (and issubclass()).
> These methods do not work on .NET classes.
> Are there alternative methods which are doing the job for .NET
> ___
> PythonNet mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/pythonnet.python.org/
> Member address: [email protected]
>
___
PythonNet mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/pythonnet.python.org/
Member address: [email protected]