[Python-ideas] Inline 'raises' expression

Georg Brandl g.brandl at gmx.net
Mon Aug 25 22:27:55 CEST 2008


Raymond Hettinger schrieb:
> From: "Fredrik Johansson" <fredrik.johansson at gmail.com>
>> one could just write
>> 
>>    assert 1/0 raises ZeroDivisionError
> 
> +1
> 
> This would be a nice extension to the assertion syntax.

It certainly looks good, and is probably implemented quickly.
However, it introduces a new pseudo-keyword, like "as" was in the past,
as we certainly don't want to make "raises" a "full" one.

Georg




More information about the Python-ideas mailing list