isnumber#

isnumber(obj, isnan=None)[source]#

Determine whether or not the input is a number.

Parameters:
  • obj (any) – the object to check if it’s a number

  • isnan (bool) – an optional additional check to determine whether the number is/isn’t NaN

Almost identical to isinstance(obj, numbers.Number).