Marat Sharafutdinov wrote:
try:
any_module.anything
except any_module.__ exception__:
I'm not convinced that there are realistic use cases for this.
Personally I've never been interested in catching exceptions based on which
module they originated from. If there's a specific condition I want to catch
and it has a distinctive exception class, I find out its class either from
the documentation or by experiment. Otherwise it's just a matter of
"something unexpected went wrong" and I treat it the same regardless of
which module or library raised it.
If you have an actual use case from real live code, please tell us more.
--
Greg
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/FAQ2YQEJK75XQ4JOFFXB3CN5YUK4XDRX/
Code of Conduct: http://python.org/psf/codeofconduct/