Duplicate: What’s the canonical way to check for type in python?
How do I check for type equality in IronPython?
I need the equivalent of the following C# code in IronPython:
if (x.GetType() == typeof(xType))
or
if (x is xType)
Duplicate: What’s the canonical way to check for type in python?
How do I check for type equality in IronPython?
I need the equivalent of the following C# code in IronPython:
if (x.GetType() == typeof(xType))
or
if (x is xType)
Say C is a static class, not fully qualified but imported into the iron python script x is an instance of C And A.B.C is the fully qualified name
Why don't these work?
x.GetType() == Type.GetType("A.B.C")
OR
x is Type.GetType("A.B.C")
OR
x is C
OR
x.GetType() == Type.GetType(C)