Skip to main content

Mojo function

repr

repr[T: Representable](value: T) -> String

Returns the string representation of the given value.

Parameters:

  • T (Representable): The type of value. Must implement the Representable trait.

Args:

  • value (T): The value to get the string representation of.

Returns:

String: The string representation of the given value.

repr[T: Representable & Movable & Copyable](value: List[T]) -> String

Returns the string representation of a List[T].

Parameters:

Args:

  • value (List): A List of elements T.

Returns:

String: The string representation of List[T].

repr[K: ExplicitlyCopyable & Movable & Hashable & EqualityComparable & Representable, V: ExplicitlyCopyable & Movable & Representable](value: Dict[K, V]) -> String

Returns the string representation of a Dict[K,V].

Parameters:

Args:

  • value (Dict): A Dict of keys K and elements V.

Returns:

String: The string representation of Dict[K,V].

repr[U: ExplicitlyCopyable & Movable & Hashable & EqualityComparable & Representable](value: Set[U]) -> String

Returns the string representation of an Set[U].

Parameters:

Args:

  • value (Set): A Set of elements U.

Returns:

String: The string representation of Set[U].

repr[U: Representable & Copyable & Movable](value: Optional[U]) -> String

Returns the string representation of an Optional[U].

Parameters:

Args:

  • value (Optional): A Optional of element type U.

Returns:

String: The string representation of Optional[U].

repr[U: ExplicitlyCopyable & Movable & Writable](value: LinkedList[U]) -> String

Returns the string representation of an LinkedList[U].

Parameters:

Args:

  • value (LinkedList): A LinkedList of element type U.

Returns:

String: The string representation of LinkedList[U].

repr[T: Representable & ExplicitlyCopyable & Movable](value: Deque[T]) -> String

Returns the string representation of an Deque[U].

Parameters:

Args:

  • value (Deque): A Deque of element type U.

Returns:

String: The string representation of Deque[U].

repr(value: None) -> String

Returns the string representation of None.

Args:

  • value (None): A None value.

Returns:

String: The string representation of None.

Was this page helpful?