> A reasonable conclusion, but needs better reasoning. One could
> certainly do an:
> assert_stmt ::= "assert" (expression ["," expression])
I don't understand that change. Adding parentheses in the EBNF
merely adds grouping in the grammar; it doesn't actually change the
syntax.
Perhaps you meant
assert_stmt ::= "assert" "(" expression ["," expression] ")"
> and implement it, when there isn't a -O, as:
> __assert__(expression, message=None) # built-in
For the issue under discussion, this is unrelated.
In any case, this would be another incompatible change.
Python 2.4.5 (#2, Mar 12 2008, 00:15:51)
[GCC 4.2.3 (Debian 4.2.3-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
py> assert 3>0, a
py>
Here, the "message" expression isn't evaluated unless the assertion
fails. With your change, it would be evaluated.
Regards,
Martin
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com