Skip to content

assert shall not be used in production code (control flow) #83

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

Open
boris-42 opened this issue Jul 11, 2020 · 0 comments
Open

assert shall not be used in production code (control flow) #83

boris-42 opened this issue Jul 11, 2020 · 0 comments

Comments

@boris-42
Copy link
Contributor

Asserts should be used only in tests, and should not be used in production code, like here and in other places

https://github.com/RedisGraph/redisgraph-py/blob/master/redisgraph/path.py#L7

There are 2 problems:

  1. If you run with python -o, all these asserts will be ignored and code will stop working
  2. It's a best practice to use own Exceptions or at least default like ValueError with human readable messages
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