Terry Reedy wrote:
> "Guido van Rossum" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
>> I wonder if "raise ValueError" should still be allowed (as equivalent
>> to "raise ValueError()") or that it should be disallowed.
>
> +1 for disallow.
> 
> raise <exception class instance> is a simple rule to remember.
> 
> Having VE == VE() in certain contexts is/would be like haveing s.len == 
> s.len() or func == func() (a moderately frequent newbie request) in certain 
> contexts.
> 
> Plus, why encourage less-helpful, no message exceptions ;-)

Some exceptions don't need a message, such as StopIteration, and other
possibly user-defined ones meant to be caught immediately in surrounding
code.

Though I agree that it makes explanations (and probably some bits of code)
easier to only allow instances after raise.

Georg

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to