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

Remove parenthesis from asserts #699

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

miguelusque
Copy link

The 'assert' syntax is that this statement doesn’t require a pair of parentheses to group the expression and the optional message. In Python, 'assert' is a statement instead of a function.

The parentheses turn the assertion expression and message into a two-item tuple, which always evaluates to true, making the assertion useless.

The 'assert' syntax is that this statement doesn’t require a pair of parentheses to group the expression and the optional message. In Python, 'assert' is a statement instead of a function.

The parentheses turn the assertion expression and message into a two-item tuple, which always evaluates to true, making the assertion useless.
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

Successfully merging this pull request may close these issues.

1 participant