Spot the invalid syntax

Chris Angelico rosuav at gmail.com
Thu Mar 8 18:42:35 EST 2018


On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Chris Angelico <rosuav at gmail.com> writes:
>
>> (Sometimes, you just need another pair of eyes.)
>
> In many cases, those eyes can be virtual and non-human.
>
> That's what syntax highlighting, and tools even more impressive (e.g.
> linting tools that run continually), offer in a programmer's text
> editor: a pair of eyes looking for mistakes while you type.
>

Often true, but not always.

What would often be useful, but I've not usually (ever?) seen, is a
linter rule that continuation lines MUST be indented further than the
initial line. That would catch this problem, because the "return" line
is being misparsed as a continuation line, but it's indented far less.

ChrisA



More information about the Python-list mailing list