Just wanted to say that a silent reader like me learnt more about PEP-8 solely from this thread than my mentor at work or any other course I have taken earlier this year. Thank you so much.
On Sun, 18 Dec 2022, 00:16 Rob Cliffe via Python-list, < python-list@python.org> wrote: > > > On 15/12/2022 04:35, Chris Angelico wrote: > > On Thu, 15 Dec 2022 at 14:41, Aaron P <transreduction...@gmail.com> > wrote: > >> I occasionally run across something like: > >> > >> for idx, thing in enumerate(things): > >> if idx == 103: > >> continue > >> do_something_with(thing) > >> > >> It seems more succinct and cleaner to use: > >> > >> if idx == 103: continue. > >> > >> > >> Nothing at all wrong with writing that on a single line. If you have > >> issues with Flake8 not accepting your choices, reconfigure Flake8 :) > >> > >> ChrisA > I'm so glad that Chris and others say this. It (i.e. if plus > break/continue/return on a single line) is something I have quite often > done in my own code, albeit with a feeling of guilt that I was breaking > a Python taboo. Now I will do it with a clear conscience. 😁 > Best wishes > Rob Cliffe > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list