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
Replace all assertions in Python code with if statements #165
Comments
Hi @saharNooby! I'm a first-time contributor and I'm interested to work on this. From To If so, I think I'd be able to help. 👍 |
@whitealpa It's good! But if possible, I'd like to suggest that we use error types other than
Since we do not It's nice to see we have more contributors for help! |
@chenpan321 Oh, my.. You’re absolutely right! I’ve read your PR but still missed it. 😅 |
@whitealpa Note that the expression must be inverted. You've suggested:
...but it will actually throw the exception when the prompt is not empty, which is not what we've intended. The correct option would be either of those:
|
As for exception type, I think |
@saharNooby @chenpan321 |
Please check: #167 |
Thanks to @chenpan321, I've become aware that Python is allowed to ignore assertions if
-O
flag is used.I've always meant the assertions to be always-run checks; they test important preconditions and are meant to make user's life better by providing clear messages specifying the exact problem.
So, we need to replace all
assert
s withif
s.See this PR for an example of a replacement.
The text was updated successfully, but these errors were encountered: