Question about raise and exceptions.

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Wed Feb 28 17:55:51 EST 2007


Ben Finney a écrit :
(snip)
> The syntax of the 'raise' statement requires one, two, or three
> arguments, all of which instruct 'raise' what to do, and none of which
> refer to arguments given to the exception instance.

Not quite. If the first argument is a class and the second argument is 
not an instance of that class, then it's passed as argument for 
instanciating the class - if it's a tuple, it's passed using the *args 
expansion.




More information about the Python-list mailing list