IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: Nightly
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

flatten

flatten(t: IntTuple) -> IntTuple

Flatten a nested IntTuple into a single-level IntTuple.

This function converts a hierarchical IntTuple structure into a flat sequence of integer values, preserving the order of elements.

Args:

  • t (IntTuple): The nested IntTuple to flatten.

Returns:

IntTuple: A new IntTuple containing all integer values in a flat structure.