deta / deta-python

deta's official sdk
https://deta.space/docs/en/build/reference/sdk/base
MIT License
153 stars 26 forks source link

Use explicit exception raising instead of asserts #46

Closed leits closed 2 years ago

leits commented 3 years ago

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 commented 3 years ago

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

abdelhai commented 3 years ago

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

abdelhai commented 2 years ago

thanks Andrii! should be resolved by #69