Uh oh!
There was an error while loading. Please reload this page.
Improve @overload detection - #435
Conversation
Zac-HD
commented
Feb 28, 2019
Hurray! This fixes another bug too: in the current released version, using a decorator named overload=lambdaf: f# or `def overload(arg): return arg@overloaddeffunc(arg): passdeffunc(arg): return ...Happily I've confirmed that this change fixes pyflakes for both the minimal case above (which might be worth adding as another test case for this PR?) and for Hypothesis - thanks @asottile 😍 |
asottile
commented
Feb 28, 2019
Zac-HD
commented
Feb 28, 2019
Yeah, probably... still fixed though and still fixed by you 😁 |
asottile
commented
Feb 28, 2019
heh only fair -- I broke it in the first place /o\ |
kelseyfrancis
commented
Jun 26, 2019
Thanks for fixing this! Could you all please cut a pypi release that includes this fix? |
Note that because of a bug fix in Python 3.8, the position of `noqa: F811` for @overload has to be changed (see also https://gitlab.com/pycqa/flake8/issues/583). So, if we want to pass flake8 both with Python 3.7 and 3.8, we need to put `noqa: F811` for two lines per @overload. This situation will be resolved by a new release of pyflakes with improving @overload detection PyCQA/pyflakes#435.
Note that because of a bug fix in Python 3.8 (see https://gitlab.com/pycqa/flake8/issues/583) we need `noqa: F811` for two lines per @overload if we want to pass flake8 both with Python 3.7 and 3.8. This situation will be resolved by a new release of pyflakes with improving @overload detection PyCQA/pyflakes#435.
omry
commented
Jan 4, 2020
When is this expected to make it to flake8? |
asottile
commented
Jan 4, 2020
no current plan, but you can read my thoughts here or as a temporary workaround install from |
omry
commented
Jan 4, 2020
Looks like this issue still happens with master on python 3.8. |
asottile
commented
Jan 4, 2020
doesn't happen for me? try uninstalling |
omry
commented
Jan 4, 2020
You are right, I had a system wide flake8 installed and bash already had it cached as flake8. |
omry
commented
Jan 5, 2020
@ asottile, unfortunately depending on a git version in setup.py prevents publishing a package. |
asottile
commented
Jan 5, 2020
it's a bit unusual to depend on pyflakes in (I also don't have pypi permission, I believe @bitglue manages that) |
omry
commented
Jan 5, 2020
Sure: Because of this overload bug, I am also depending on pyflake to get this bugfix. |
asottile
commented
Jan 5, 2020
ah I see -- those dependencies aren't for your consumers so there isn't really a need to put them in |
developers are also consumers. my noxfile is also settings up in the same way. |
asottile
commented
Jan 5, 2020
yeah I notice you're using pre-commit -- I'm the author (you've got it set up in a less-than-supported manner -- first you don't need when I said consumers above, I meant people that would install your package -- I understand you still want to have a developer workflow, I'm just suggesting that while |
omry
commented
Jan 5, 2020
Thanks for the pointers! didn't realize you are the author of pre-commit hooks. |
omry
commented
Jan 6, 2020
I fixed the pre-commit config for black to not use the local escape hatch, but I am not sure how to do it for flake8 given the need to install a specific revision of pyflakes. |
asottile
commented
Jan 6, 2020
something like this: - repo: https://gitlab.com/pycqa/flake8rev: 3.7.9hooks:
- id: flake8additional_dependencies: [-e, git+https://github.com/pycqa/pyflakes@...] |
omry
commented
Jan 6, 2020
Awesome, thanks! |
We had this TODO for a long time. That when PyCQA/pyflakes#435 made it into a release we could get rid of the noqa:F811 exceptions. We have indeed upgraded pyflakes since then and now it's doable
Resolves#434