survive.utils.check_int

survive.utils.check_int(num, *, minimum=None, maximum=None, allow_none=False)[source]

Validate integer function arguments.

Parameters:
num : object

The object to be validated.

minimum : int, optional

The minimum value that num can take (inclusive).

maximum : int, optional

The maximum value that num can take (inclusive).

allow_none : bool, optional

Indicates whether the value None should be allowed.

Returns:
num : integer type or None

The validated integer.

Raises:
TypeError

If num is not an integer.

ValueError

If any of the optional minimum and maximum value constraints are violated.