tuple_sorttuple_sortTupleSortTupleSorttuple_sort (Operator)
Name
tuple_sorttuple_sortTupleSortTupleSorttuple_sort
— Sort the elements of a tuple in ascending order.
Signature
def tuple_sort(tuple: MaybeSequence[Union[float, int, str]]) -> Sequence[Union[float, int, str]]
def tuple_sort_s(tuple: MaybeSequence[Union[float, int, str]]) -> Union[float, int, str]
Description
tuple_sorttuple_sortTupleSortTupleSorttuple_sort
sorts all elements of TupleTupleTupletupletuple
in ascending order
and returns the result with SortedSortedSortedsortedsorted
. As a precondition the
single elements of TupleTupleTupletupletuple
must be comparable. Thus, TupleTupleTupletupletuple
must either exclusively consist of strings or it must only contain
(integer or floating point) numbers. In the latter case integers and
floating point numbers may be mixed.
Exception: Empty input tuple
If the input tuple is empty, the operator returns an empty tuple.
HDevelop In-line Operation
HDevelop provides an in-line operation for tuple_sorttuple_sortTupleSortTupleSorttuple_sort
,
which can be used in an expression in the following syntax:
Sorted := sort(Tuple)
Execution Information
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on internal data level.
Parameters
TupleTupleTupletupletuple
(input_control) tuple(-array) →
HTupleMaybeSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Input tuple.
SortedSortedSortedsortedsorted
(output_control) tuple(-array) →
HTupleSequence[Union[float, int, str]]HTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)
Sorted tuple.
Alternatives
tuple_sort_indextuple_sort_indexTupleSortIndexTupleSortIndextuple_sort_index
,
tuple_inversetuple_inverseTupleInverseTupleInversetuple_inverse
Module
Foundation