[Python-3000] Assert syntax change...

"Martin v. Löwis" martin at v.loewis.de
Fri Apr 25 20:00:50 CEST 2008


> 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+1+1+1+1+1+1
... >20),("The sum of many"
... "integers should be larger"
... "than a single small integer")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AssertionError: The sum of manyintegers should be largerthan a single
small integer

Regards,
Martin


More information about the Python-3000 mailing list