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
{{ message }}
Repository navigation
F811 (redefinition of unused variable) incorrectly triggered with @overload decorator #434
This bug was fixed for functions in #320. It still occurs if the function is inside a class and/or has multiple decorators (e.g. @staticmethod, @classmethod):
test.py:9:5: F811 redefinition of unused 'utf8' from line 5
test.py:13:5: F811 redefinition of unused 'utf8' from line 9
test.py:17:5: F811 redefinition of unused 'utf8' from line 13
test.py:14:1: F811 redefinition of unused 'utf8' from line 8
test.py:20:1: F811 redefinition of unused 'utf8' from line 14
test.py:26:1: F811 redefinition of unused 'utf8' from line 20
Activity
asottile commentedon Feb 22, 2019
can confirm, thanks for the report -- one of these is easy to fix -- trying to figure out the other one right now 👍
asottile commentedon Feb 22, 2019
@smoehrle want to try out the branch in #435?
smoehrle commentedon Feb 23, 2019
@asottile Can confirm the fix :) Thanks for the fast response
fr0der1c commentedon Feb 28, 2019
I am wondering... Should the
@overheaddecorator be put below or above other decorators?PyCharm complains if I put the

@overheaddecorator above other decorators.asottile commentedon Feb 28, 2019
I think it ends up not mattering, since you won't ever be calling the
@overloaddecorated methods, but the definition below them.probably a bug that pycharm reports that
https://github.com/python/cpython/blob/4173772031747a9b249be4100b4aa9eda805ea23/Lib/typing.py#L1049-L1084