2.1.42. czekitout.check.if_scalar

if_scalar(obj, obj_name)[source]

Check whether input object is a scalar.

We define a scalar as a number that is boolean, an integer, real-valued, or complex-valued.

If the input object is not a scalar, then a TypeError exception is raised with the message:

The object ``<obj_name>`` must be a scalar.

where <obj_name> is replaced by the contents of the string obj_name.

Parameters:
objany type

Input object.

obj_namestr

Name of the input object.