Reputation: 3440
While using PyCharm, I'm getting E126 continuation line over-indented for hanging indent
errors on the following code:
bool_one = True
bool_two = False
ex_var: bool = (
is_even(5) and
bool_one and
bool_two
)
I originally had these three boolean statements all on one line, but hit enter to put them on separate lines to make it easier to read. PyCharm handled the indent for me.
Upvotes: 2
Views: 1856
Reputation: 252
It seems that a multi-line comment was the cause of this same problem for me. I don't understand why, as I haven't experienced this with other python files that contained multi-line comments before today. Alas, luckily, I am able to do without the comment in this case. FWIW, the error happens for me as a multi-line comment and as a multi-line string variable.
Upvotes: 0
Reputation: 3440
It turns out PyCharm is configured (by default?) to use 8 spaces for 'continuation indent'. I changed this to 4, and now no longer receive the E126 error!
Upvotes: 2