assert_type

emlib.misc.assert_type(x, *types)[source]

Returns True if x is of the given type, raises TypeError otherwise

See istype for examples

Can be used as:

assert_type(x, int, float)

or:

assert assert_type(x, [int])
Return type:

bool