deepcave.utils.cast

# Cast

This module provides a utility to convert any value to an int if possible.

Functions

optional_int(value)

Convert a value to an int if possible.

deepcave.utils.cast.optional_int(value)[source]

Convert a value to an int if possible.

Parameters:

value (Any) – The value to be turned into an int.

Returns:

The converted int value. If not possible, return None.

Return type:

Optional[int]