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

assert behavior inconsistent with python #70

Open
bplotnick opened this issue Aug 3, 2020 · 0 comments
Open

assert behavior inconsistent with python #70

bplotnick opened this issue Aug 3, 2020 · 0 comments

Comments

@bplotnick
Copy link
Contributor

assert is a reserved keyword in python and so it cannot be used as a function. So in python, there is a tricky gotcha where the following will not fail:

assert(1 == 2, "hello")

because it is equivalent to:

assert (1==2, "hello")

which is asserting the "truthiness" of a tuple, which is True.

However, in isopod we override the assert keyword to make it a function, so the two are equivalent.

This breaks python grammar rules, which affects the ability to re-use code formatting tools like black. It's also just confusing that something that the behavior is the opposite of the python behavior.

We should either fix the grammar to allow assert as a statement or use a different function name.

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

No branches or pull requests

1 participant