assert istype(whatever, MyCustomType)
Which would throw an exception if whatever is not a "MyCustomType" at runtime.
assert istype(whatever, MyCustomType)
Which would throw an exception if whatever is not a "MyCustomType" at runtime.