You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have two blank lines, a comment, and then a nested function, E306 is raised erroneously.
(Since this false positive requires a genuine violation of E303, I don't think it's a big deal. But I noticed it, so I'm reporting it.)
The following functions both trigger false postives for E306.
For context, this snippet contains the false positives as well as cases that don't trigger E306:
defbad():
_=None# arbitrary commentdefinner(): # E306 not expected (but happening! 1/2)passdefbad():
_=None# arbitrary commentdefinner(): # E306 not expected (but happening! 2/2)passdefgood():
_=None# arbitrary commentdefinner(): # E306 not expectedpassdefgood():
_=None# arbitrary commentdefinner(): # E306 not expectedpassdefgood():
_=None# arbitrary commentdefinner(): # E306 not expectedpass
If you dump that to a file (e.g., bug.py) and run pycodestyle on it, you'll get E306 inside the two bad() functions:
$ pycodestyle --select=E306 --show-source bug.py
bug.py:7:5: E306 expected 1 blank line before a nested definition, found 0
def inner(): # E306 not expected (but happening! 1/2)
^
bug.py:16:5: E306 expected 1 blank line before a nested definition, found 0
def inner(): # E306 not expected (but happening! 2/2)
^
Let me know if there's anything I can clarify/provide, thanks!
The text was updated successfully, but these errors were encountered:
If you have two blank lines, a comment, and then a nested function, E306 is raised erroneously.
(Since this false positive requires a genuine violation of E303, I don't think it's a big deal. But I noticed it, so I'm reporting it.)
The following functions both trigger false postives for E306.
For context, this snippet contains the false positives as well as cases that don't trigger E306:
If you dump that to a file (e.g.,
bug.py
) and run pycodestyle on it, you'll get E306 inside the twobad()
functions:Let me know if there's anything I can clarify/provide, thanks!
The text was updated successfully, but these errors were encountered: