pyxx.arrays.convert_to_tuple#
- pyxx.arrays.convert_to_tuple(value: Any) tuple#
Convert an input to a tuple
Convert any input to a one-element tuple, or directly return the input (if it is already a tuple or list).
- Parameters:
value (Any) – Value to convert to a tuple
- Returns:
Directly returns
valueif it is already a tuple or list; otherwise, a one-element tuple containingvalueis returned- Return type:
tuple
Notes
This function is intended to address an issue in which a value such as
('value')is not considered a tuple (in this case, it would be a string), which may be unintuitive to users since it is in parentheses. This function addresses this issue by converting any input to a tuple