def to_list(collection):
    """:yaql:toList

    Returns list built from iterable.

    :signature: collection.toList()
    :receiverArg collection: collection to be transferred to list
    :argType collection: iterable
    :returnType: list

    .. code::

        yaql> range(3).toList()
        [0, 1, 2]
    """
    if isinstance(collection, tuple):
        return collection
    return tuple(collection)