Powered by Tachyonic Project Luxon Framework v0.0.0

Luxon Framework for rapid application development. (luxon)

Version

Data Casting Utility

To Tuple

luxon.utils.cast.to_tuple(obj)[source]

Tuple Converter

Takes any object and converts it to a tuple. If the object is already a tuple it is just returned, If the object is None an empty tuple is returned, Else a tuple is created with the object as it’s first element.

Parameters:obj (any object) – the object to be converted
Returns:A tuple containing the given object

To List

luxon.utils.cast.to_list(obj)[source]

List Converter

Takes any object and converts it to a list. If the object is already a list it is just returned, If the object is None an empty list is returned, Else a list is created with the object as it’s first element.

Parameters:obj (any object) – the object to be converted
Returns:A list containing the given object