I made a pull request for the style guide if anyone would like to review: https://github.com/django/django/pull/12350
On Mon, Jan 20, 2020 at 6:05 PM Ram Rachum <r...@rachum.com> wrote: > Jon: That's awesome! I also liked R101. I didn't think of that. > > Adam: I thought so too, but after going over dozens of R100 cases, I > didn't find even one where a raise without "from" inside an except clause > was justified. I challenge you to show me even one such example. > > On Mon, Jan 20, 2020 at 12:06 PM Adam Johnson <m...@adamj.eu> wrote: > >> Nice work Jon. I don't think we can generally apply R100 though - thre >> are definitely cases where "raise" inside an exception handler is not >> *caused* by the other exception - but maybe that's a sign refactoring is >> needed. >> >> On Sun, 19 Jan 2020 at 22:52, Jon Dufresne <jon.dufre...@gmail.com> >> wrote: >> >>> >>> > 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. >>>> >>> >>> As a weekend project, I wrote a flake8 plugin to handle this at: >>> https://pypi.org/project/flake8-raise/ >>> >>> I'm not advocating this necessarily included by the Django test suite, >>> but it can be used to review the PR. Either way, it was fun to write. >>> >>> -- >>> 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/CADhq2b4m40efQkorgji9-erXri9qSAb1VJBv%3DZ3HrOL6ksOJAQ%40mail.gmail.com >>> <https://groups.google.com/d/msgid/django-developers/CADhq2b4m40efQkorgji9-erXri9qSAb1VJBv%3DZ3HrOL6ksOJAQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> >> >> -- >> Adam >> > -- 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/CANXboVbjPhmAK-p%3DCmNACu%2BX5bnLt7gW7X9wVBXJvQSdHnLvsg%40mail.gmail.com.