what a cheap rule

Terry Reedy tjreedy at udel.edu
Thu Nov 25 18:39:57 EST 2010


On 11/25/2010 4:12 AM, Yingjie Lan wrote:
> Sometimes the golden rule in Python of
> "explicit is better than implicit" is
> so cheap that it can be thrown away
> for the trouble of typing an empty tuple.
>
> Today when I am explaining that in Python 3,
> there are two ways to raise exceptions:
>
> raise Exception
> raise Exception()

I agree with you that this is annoying. I think it is a holdover from 
the past. In Python 1/2, raise 'some string' also works, but that was 
disallowed in Py 3. A lot of things were cleaned up in Py 3, but not 
everything.

-- 
Terry Jan Reedy




More information about the Python-list mailing list