On Sat, Jan 18, 2020 at 5:05 PM Shai Berger <s...@platonix.com> wrote:
> [snip] But as it turns out, `from` puts the > original exception on the `__cause__` in *addition* to `__context__`: > > [snip] > So that is not a concern. > Awesome! I did not know that. > > Regarding automatically enforcing this format going forward: I looked > > at the list of Flake8 rules <https://www.flake8rules.com/> and > > couldn't find anything about it. > > > > Indeed, I don't think there can be -- it cannot be a style violation to > run into an error while handling another error... > I think it can be, as it's very rare to have a legitimate exception without a "raise from" inside an except clause. In almost any context in which "during handling of..." is correct, the raising is done deeper in the stack. I think it's rare enough that personally, I would have liked to have a Flake8 / PyLint rule like that enforces it, and allow ignoring it with a comment. (As much as I hate Lint ignore comments.) -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CANXboVYxb%2BMeOHp%3De4gzqroKWkHzLjeGXy55qJyRLQQVcUPrWg%40mail.gmail.com.