On Sat, 18 Jan 2020 17:18:41 +0200
Ram Rachum <r...@rachum.com> wrote:

> On Sat, Jan 18, 2020 at 5:05 PM Shai Berger <s...@platonix.com> wrote:
> 
> > > 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.)

That makes sense. And you know, flake8 supports plugins... a couple of
web searches and "pip search flake8 | grep {raise,from,chain}" didn't
pull anything which seems relevant, but if so, it can be written.

Shai.

-- 
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/20200118174903.5d9b2247.shai%40platonix.com.

Reply via email to