Is it possible to check if a .NET class is a subclass of another .NET class
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
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 <robert.hoelzl@posteo.de>:
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 -- pythonnet@python.org To unsubscribe send an email to pythonnet-leave@python.org https://mail.python.org/mailman3/lists/pythonnet.python.org/ Member address: gregor.hd@gmx.de
I am sorry! isinstance() and issubclass() are both working fine! (I tested isinstance(StackPanel, Panel) instead of isinstance(StackPanel(), Panel)
participants (2)
-
gregor.hd@gmx.de
-
robert.hoelzl@posteo.de