def abs(x): if not isinstance(x, (int,float)): raise TypeError('x must be numeric') return x if x > 0 else -x