You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per Python's documentation for the assert statement, an assert expression is equivalent to:
if__debug__:
ifnotexpression: raiseAssertionError
Also:
In the current implementation, the built-in variable __debug__ is True under normal circumstances, False when optimization is requested (command line option -O). The current code generator emits no code for an assert statement when optimization is requested at compile time.
This makes using assert for validators unreliable. Flask-Lastuser uses them in a few places. These should be replaced with an explicit if not expression: raise ValueError
The text was updated successfully, but these errors were encountered:
As per Python's documentation for the
assert
statement, anassert expression
is equivalent to:Also:
This makes using
assert
for validators unreliable. Flask-Lastuser uses them in a few places. These should be replaced with an explicitif not expression: raise ValueError
The text was updated successfully, but these errors were encountered: