Mojo function
assert_is
assert_is[T: Stringable & Identifiable](lhs: T, rhs: T, msg: String = __init__[__mlir_type.!kgen.string](""), *, location: Optional[_SourceLocation] = Optional(None))
Asserts that the input values have the same identity. If they do not then an Error is raised.
Parameters:
- T (
Stringable & Identifiable
): A Stringable and Identifiable type.
Args:
- lhs (
T
): The lhs of theis
statement. - rhs (
T
): The rhs of theis
statement. - msg (
String
): The message to be printed if the assertion fails. - location (
Optional[_SourceLocation]
): The location of the error (defaults to__call_location
).
Raises:
An Error with the provided message if assert fails and None
otherwise.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!