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

Use explicit exception raising instead of asserts #46

Closed
leits opened this issue Aug 13, 2021 · 3 comments
Closed

Use explicit exception raising instead of asserts #46

leits opened this issue Aug 13, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@leits
Copy link
Contributor

leits commented Aug 13, 2021

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

https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement
and https://stackoverflow.com/questions/944592/best-practice-for-using-assert

Please, don't use asserts outside of tests 😃

@leits leits closed this as completed Aug 13, 2021
@leits leits reopened this Aug 13, 2021
@leits
Copy link
Contributor Author

leits commented Aug 13, 2021

Found good examples in the repository:
https://github.com/deta/deta-python/blob/master/deta/base.py#L84-L86

@abdelhai abdelhai added the enhancement New feature or request label Aug 14, 2021
@abdelhai
Copy link
Member

Thanks @leits for the feedback! We will consider it in our next release. I think in general, we need to raise better errors.

@abdelhai
Copy link
Member

thanks Andrii! should be resolved by #69

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

No branches or pull requests

2 participants