How to do this:
if n is Control:
When you have a string that is the name of the type?
type = "Control" # Comes from somewhere, like an exported var set in editor
if n is type_string:
The latter causes Parser Error: Invalid 'is' test: right operand is not a type (not a native type nor a script).