On Tue, Oct 13, 2020 at 1:56 PM <jmwar...@gmail.com> wrote: > I do agree that it is nice to have some ability to type the call more > rigidly, just like a function call. I could see having functions, > optionally, advertise exception calls as possible alternate returns but > this should be just that, optional just to help out clarity.
OK. But in 22 years, I've never had a desire to raise with custom args, and I've often had a desire to express inheritance relationships. So this need feels to me to be rare, at most (and probably usually an antipattern). That said, the ExceptionMaker that I proposed gets you exactly what you want already. I like Chris' idea of defaultdict and square brackets even better than mine about memoization (maybe with @functools.lru_cache). Either way, you already HAVE what you are asking for, except few people actually want to use it. -- The dead increasingly dominate and strangle both the living and the not-yet born. Vampiric capital and undead corporate persons abuse the lives and control the thoughts of homo faber. Ideas, once born, become abortifacients against new conceptions.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/MEFTV6XOKZ2MCHQQXMSF7ATJZRJ4HE5Y/ Code of Conduct: http://python.org/psf/codeofconduct/