pydoclint icon indicating copy to clipboard operation
pydoclint copied to clipboard

Allow documentation of dunder methods

Open oliversheridanmethven opened this issue 3 months ago • 1 comments

For a class I may have a dunder method (e.g. __contains__ or __exit__) where I may have some non-trivial behaviour that needs documenting. The tool currently does not check this as far as I can tell.

oliversheridanmethven avatar Sep 26 '25 14:09 oliversheridanmethven

I think pydoclint already can check this.

I used pydoclint 0.7.5 on this code example:

class MyClass(object):
    def __contains__(self, item: int) -> bool:
        """
        Contains something

        Args:
            item (int2): The item

        Returns:
            bool: the return value
        """
        pass

And I got the following violation, as expected:

['DOC105: Method `MyClass.__contains__`: Argument names match, but type hints '
 'in these args do not match: item']

jsh9 avatar Oct 25 '25 05:10 jsh9

Closing this issue, since it appears pydoclint already handles this.

jsh9 avatar Nov 23 '25 01:11 jsh9