I would like to raise a sort-of ultimatum to everyone in this thread.

As far as I know, the `raise foo from bar` syntax, and the distinction between the two exception-chaining messages, didn't really catch on. I know about them, like them and use them, but most Python developers and open-source packages don't. 

If I understand correctly, the `raise from` syntax was introduced in Python 3.0, so in 2008. It's been with us for 12 years. We finally made the transition to Python 3, and I feel that most Python developers I interact with are using Python 3. But the `raise from` syntax is something that's still considered esoteric.

My point is that so far, its adoption was a failure.

If we have any hopes that its adoption will be a success, we should think, what is our plan for its success? Here are a few options:

1. Keep waiting a few more years and see whether people will spontaneously feel like starting to use it.
2. Accept the fact that it's a failed feature that would never get adopted.
3. Start an effort to transition to `raise from` in appropriate cases in high-profile Python projects such as Django, hoping it'll trickle down from there to the wider public.
4. Figure out why people don't use `raise from`, and find solutions to these problems. If the Django maintainers don't use it because it's too verbose, introduce less verbose way. Even if it takes 6 years to get into Django because of the release delay, it's worth to start working on it now.
5. Accept the fact that Django isn't the beacon of Pythonic-ness that many of us see it as, and maybe it can stay behind in this regard while other, newer projects are adopting more Pythonic practices.

Any other options?


On Fri, Feb 7, 2020 at 8:11 PM Chris Angelico <rosuav@gmail.com> wrote:
On Sat, Feb 8, 2020 at 4:51 AM Shai Berger <shai@platonix.com> wrote:
> To summarize, I am suggesting that
>
>         except ExceptionType:
>                 raise as OtherException(...)
>
> Have, more-or-less, the semantics of Python 2's:
>
>         except ExceptionType:
>                 traceback = sys.exc_info()[2]
>                 raise OtherException, OtherException(...), traceback
>

-1. That would mean that a line of code could phantom-raise an
exception that it has no idea even exists. I'd much rather it be
defined with semantics based on existing exception chaining (which is
what Ram's original proposal was).

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@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/3PXWFVP7NCZHXHCMLX3AXAS2DVUWL43V/
Code of Conduct: http://python.org/psf/codeofconduct/