Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Wrong "D105: Missing docstring in magic method" for overload function #525

Open
ITProKyle opened this issue Feb 11, 2021 · 1 comment · May be fixed by #571
Open

Wrong "D105: Missing docstring in magic method" for overload function #525

ITProKyle opened this issue Feb 11, 2021 · 1 comment · May be fixed by #571

Comments

@ITProKyle
Copy link

Similar to #419 but for class magic methods.

The following example results in the the two overloaded __getitem__ methods to be flagged with D105. The expected result is that they are not flagged.

from typing import Iterable, List, MutableSequence, TypeVar, overload

_T = TypeVar("_T")

class MyClass(MutableSequence(_T)):
    """Example class."""

    def __init__(self, iterable: Iterable[_T]) -> None:
        """Instantiate class."""
        self._data = list(iterable)

    @overload
    def __getitem__(self, __index: int) -> _T:
        ...

    @overload
    def __getitem__(self, __index: slice) -> List[_T]:
        ...

    def __getitem__(self, __index):
        """Get item by index."""
        return self._data[__index]
@yumasheta yumasheta linked a pull request Jan 13, 2022 that will close this issue
2 tasks
ruestefa added a commit to ruestefa/atmcirclib that referenced this issue Jun 9, 2022
Note: pydocstyle complaints due to missing docstrings in overloaded magic
methods ignored as they should be fixed in the forseeable future (see
PyCQA/pydocstyle#525)
@jenstroeger
Copy link

Probably also related is issue #635

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

Successfully merging a pull request may close this issue.

2 participants