Re: [Python-3000] Assert syntax change...

2008-06-24 Thread Charles Merriam
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

Re: [Python-3000] Assert syntax change...

2008-04-25 Thread Martin v. Löwis
> 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

Re: [Python-3000] Assert syntax change...

2008-04-25 Thread Martin v. Löwis
> 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

Re: [Python-3000] Assert syntax change...

2008-04-24 Thread Nick Coghlan
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

Re: [Python-3000] Assert syntax change...

2008-04-24 Thread Greg Ewing
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

Re: [Python-3000] Assert syntax change...

2008-04-24 Thread Charles Merriam
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

Re: [Python-3000] Assert syntax change...

2008-04-24 Thread Guido van Rossum
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

Re: [Python-3000] Assert syntax change...

2008-04-24 Thread Mikhail Glushenkov
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

Re: [Python-3000] Assert syntax change...

2008-04-24 Thread Guido van Rossum
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

[Python-3000] Assert syntax change...

2008-04-24 Thread Charles Merriam
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: