bsfs.utils.commons module#

bsfs.utils.commons.normalize_args(*args: ArgType | Iterable[ArgType] | Iterator[ArgType]) Tuple[ArgType, ...]#

Arguments to a function can be passed as individual arguments, list-like structures, or iterables. This function processes any of these styles and returns a tuple of the respective items. Typically used within a function provide a flexible interface but sill have parameters in a normalized form.

Examples:

>>> normalize_args(0,1,2)
(1,2,3)
>>> normalize_args([0,1,2])
(1,2,3)
>>> normalize_args(range(3))
(1,2,3)
bsfs.utils.commons.typename(obj) str#

Return the type name of obj.