raise None

Paul Rubin no.email at nospam.invalid
Wed Dec 30 19:19:54 EST 2015


Steven D'Aprano <steve at pearwood.info> writes:
> def _validate(a, b): 
>     if condition(a) or condition(b): return TypeError
> ...
> Obviously this doesn't work now, since raise None is an error, but if it did
> work, what do you think?

Never occurred to me.  But in some analogous situations I've caught
the exception inside _validate, then peeled away some layers of the
traceback from the exception output before throwing again.



More information about the Python-list mailing list