Skip to content

Try not to rely on assert for logic in production code #1

@n8henrie

Description

@n8henrie

With optimizations enabled, it will completely disappear, meaning for consistent behavior you need to reproduce its functionality. Additionally, users will appreciate being able to catch a more meaningful error than AssertionError in their dependent code.

https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement

The current code generator emits no code for an assert statement when optimization is requested at compile time.

https://stackoverflow.com/a/1838411/1588795

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions