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

Mojo function

is_int

def is_int(t: IntTuple) -> Bool

Check if an IntTuple represents a single integer value.

This function determines whether the given IntTuple contains a single integer value rather than a nested tuple structure.

Example:

from layout.int_tuple import is_int, IntTuple

var single_value = IntTuple(5)
var nested_tuple = IntTuple(1, 2, 3)

var result1 = is_int(single_value)  # Returns True
var result2 = is_int(nested_tuple)  # Returns False

Args:

  • t (IntTuple): The IntTuple to check.

Returns:

Bool: True if the IntTuple contains a single integer value, False if it's a nested tuple.

Was this page helpful?