Skip to content

Add an "assert" function #252

@carlosgalvezp

Description

@carlosgalvezp

Hi,

There is already a fail function, but it's not ergonomic to use, because it takes 2 lines and 1 added indentation level. It would be good if we could have a assert function. Consider:

if (not condition):
   fail("Error message")

vs

assert(condition, "Error message")

The same code with assert is much cleaner. It's also consistent with most programming languages.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions