Error raising style

Fredrik Lundh effbot at telia.com
Sun Feb 6 19:44:37 CET 2000


Gerrit Holl <gerrit.holl at pobox.com> wrote:
> But I find this better:
> >>> raise Exception('aaa')
>
> because when raising an error with multiple errors, the former isn't
> possible:
> >>> raise Exception, 'aaa', 'bbb'
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> TypeError: raise 3rd arg must be traceback or None

raise Exception, ('aaa', 'bbb')

> Guido's style guide doesn't talk about it, probably because the
> call-raising is only possible since class exceptions. Is all those
> code because of backward compatibility and people who are used to
> this style of raising exceptions?
>
> What do you think?

your guess is as good as mine...

</F>





More information about the Python-list mailing list