Repository navigation
Pep8 doesn't speak to the walrus #12147
Description
Activity
@pllim I see this issue has been raised in pep8speaks-org/pep8speaks#173
A suggested fix is to usepycodestyleover flake8.
Or we could just wait until pep8speaks-org/pep8speaks#173 is fixed...- changed the title
[-]Pep8 speaks vs. the walrus[/-][+]Pep8 doesn't speak to the walrus[/+]on Sep 5, 2021 - addedUpstream Action RequiredWas: Upstream Fix RequiredWas: Upstream Fix Required
on Sep 6, 2021 If upstream can fix it within reasonable time frame, we can wait?
It doesn't make the CI fail; just gives a false error in the PR message. So long as maintainers know to ignore it, it's not a showstopper. The PR to fix the PEP8speaks error is a bit old, but now that many NumPy affiliated packages are dropping py3.7, I hope it's resolved soon...
flake8 does much more than pycodestyle so there shouldn't be a downgrade switch, the early adoption of walrus doesn't worth it imo. For cases like this, do patch upstream.
Reacted by P. L. Lim and Nathaniel StarkmanJust confirming, pep8speaks only runs on the diff. So a walrus in the codebase wouldn't make future PRs error, right?
So a walrus in the codebase wouldn't make future PRs error, right?
Theoretically, no.
Reacted by Nathaniel StarkmanCan confirm it only complains on new PRs. There are now a few walruses in the code and they are not stirring up trouble.
Side note. pep8speaks also complains about positional-only arguments
def function(x, /): print(x, "is a positional-only argument")
We don't have pep8speaks anymore!
Reacted by P. L. Lim
Description
Pep8speaks doesn't like walrus operators.
Expected behavior
Now that we are py3.8+ (#11934), this should not trip up the checker.
Actual behavior
Pep8speaks flags
:=as invalid syntax.#12136 (comment)
Steps to Reproduce
Push code with a
:=to astropy.System Details
N/A.