Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive function-redefined for methods with the typing.overload decorator #2239

Closed
brycepg opened this issue Jul 2, 2018 · 4 comments
Labels
Enhancement ✨ Improvement to a component

Comments

@brycepg
Copy link
Contributor

brycepg commented Jul 2, 2018

function-redefined should ignore functions/methods with the typing.overload decorator since these function stubs are only used to give type information.

Example:

from typing import overload

@overload # Ignore
def process(response: None) -> None:
    ...
@overload # Ignore
def process(response: int) -> Tuple[int, str]:
    ...
@overload # Ignore
def process(response: bytes) -> str:
    ...
def process(response):
    <actual implementation>
@brycepg brycepg added the Enhancement ✨ Improvement to a component label Jul 2, 2018
@SLAPaper
Copy link

Just encounter this problem, is there any fixes? Or is it OK to add an # pylint: disable=function-redefined to the code for now?

@PCManticore
Copy link
Contributor

@SLAPaper Feel free to disable it for now, we didn't get to work on it just yet.

@SLAPaper
Copy link

@PCManticore Thanks!

@AWhetter
Copy link
Contributor

Closing as a duplicate of #1581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component
Projects
None yet
Development

No branches or pull requests

4 participants