def _isnumber(obj):
    """Test is object is a number (copied from pmisc module to avoid import loops)."""
    return (
        (obj is not None)
        and (not isinstance(obj, bool))
        and isinstance(obj, (int, float, complex))
    )