Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
n8henrie opened this issue Dec 8, 2020 · 0 comments
Open

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

n8henrie opened this issue Dec 8, 2020 · 0 comments

Comments

@n8henrie
Copy link
Contributor

n8henrie commented Dec 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant