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

missing-kwoa is returned when using @overload #3655

Closed
tetienne opened this issue May 29, 2020 · 1 comment · Fixed by #3673
Closed

missing-kwoa is returned when using @overload #3655

tetienne opened this issue May 29, 2020 · 1 comment · Fixed by #3673
Assignees
Labels

Comments

@tetienne
Copy link

tetienne commented May 29, 2020

Hi, my issue is similar to #3421.

Code Sample

class PageObject:
    logger = logging.getLogger(__name__)

    @overload
    def __init__(self, *, driver: Driver):
        ...

    @overload
    def __init__(self, *, by: Tuple[By, str], driver: Driver):
        ...

    @overload
    def __init__(self, *, context: WebElement):
        ...

    @overload
    def __init__(self, *, by: Tuple[By, str], parent: PageObject):
        ...

    @overload
    def __init__(self, *, parent: PageObject):
        ...

    def __init__(
        self,
        *,
        by: Optional[Tuple[By, str]] = None,
        context: Optional[WebElement] = None,
        parent: Optional[PageObject] = None,
        driver: Optional[Driver] = None,
    ) -> None:
      # Some code...
class IabCategories(PageObject):
    def __init__(self, *, by: Tuple[By, str], parent: PageObject):
        super().__init__(by=by, parent=parent) # Error here
        # Some code...

Current behavior

E1125: Missing mandatory keyword argument 'driver' in method call (missing-kwoa)

Expected behavior

If I'm right, no error must be raised. These overloads are here to help mypy. If I remove them, pylint is ok but not mypy.

pylint --version output

pylint 2.5.2
astroid 2.4.1
Python 3.7.2 (default, Mar 26 2019, 11:28:28) 
[GCC 5.4.0 20160609]
pylint 2.5.2
astroid 2.4.1
Python 3.7.2 (default, Mar 26 2019, 11:28:28) 
[GCC 5.4.0 20160609]
pylint 2.5.2
astroid 2.4.1
Python 3.7.2 (default, Mar 26 2019, 11:28:28) 
[GCC 5.4.0 20160609]
pylint 2.5.2
astroid 2.4.1
Python 3.7.2 (default, Mar 26 2019, 11:28:28) 
[GCC 5.4.0 20160609]
@tetienne
Copy link
Author

@PCManticore Thank you.

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

Successfully merging a pull request may close this issue.

2 participants