def complex_check ( * args , func = None ) : func = func or inspect . stack ( ) [ 2 ] [ 3 ] for var in args : if not isinstance ( var , numbers . Complex ) : name = type ( var ) . __name__ raise ComplexError ( f'Function {func} expected complex number, {name} got instead.' )
how does python compare complex number
Check if arguments are complex numbers .
def complex_check(*args, func=None):
    """Check if arguments are complex numbers."""
    func = func or inspect.stack()[2][3]
    for var in args:
        if not isinstance(var, numbers.Complex):
            name = type(var).__name__
            raise ComplexError(
                f'Function {func} expected complex number, {name} got instead.')