Sorry to bring up the old assert syntax issue; I wanted to clarify it
before explaining to someone.
For: assert expr, message_expr
It seems to be left at:
1. The assert statement is left unchanged in 3.0.
2. Asserting a tuple now creates a _compile time_ warning to try to
prevent assert(expr,m
> 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.
P
> Independently of that, changing assert to allow surrounding parentheses
> (similar to the name list in a from module import name-list style import
> statement) would also be convenient for longer expressions or error
> messages.
But that's already supported...
py> assert (1+1+1+1+1+1
... +1+1+1
Charles Merriam wrote:
On Thu, Apr 24, 2008 at 2:01 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
On Thu, Apr 24, 2008 at 1:51 PM, Mikhail Glushenkov
Why not make ``assert`` a built-in function then?
Because then it can't be disabled by the compiler in -O mode.
A reasonable conclusion, b
Charles Merriam wrote:
It would be great to change assert from:
assert_stmt::= "assert" expression ["," expression]
To:
assert_stmt::= "assert" expression ["as" expression]
I don't think "as" is the right word to use here...
maybe
assert else
That is, w
On Thu, Apr 24, 2008 at 2:01 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> On Thu, Apr 24, 2008 at 1:51 PM, Mikhail Glushenkov
> > Why not make ``assert`` a built-in function then?
> Because then it can't be disabled by the compiler in -O mode.
A reasonable conclusion, but needs better reaso
On Thu, Apr 24, 2008 at 1:51 PM, Mikhail Glushenkov
> Why not make ``assert`` a built-in function then?
Because then it can't be disabled by the compiler in -O mode.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-3000 mail
Hello,
Guido van Rossum python.org> writes:
>
> I sympathize with the sentiment, but 'as' is the wrong keyword;
Why not make ``assert`` a built-in function then?
___
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/list
I sympathize with the sentiment, but 'as' is the wrong keyword; there
is no assignment to the thing on its right hand side like there is in
all other places where it is used in the syntax (import-as, with-as,
except-as).
Also, have you actually tried this in 3.0? It prints a nice
SytaxWarning mess
Hello All,
I expect it is far to late for this, and I still wanted to make the issue known.
The assert statement is one of the few remaining Python statements
where it (1) does not use parenthesis and (2) takes multiple
arguments. This leads to the common, hard to detect, programming
error:
10 matches
Mail list logo