Closed barseghyanartur closed 3 months ago
Hey, is there an update on this? Would love to see this functionality!
I also came here, since I'm interested in an option to ignore methods decorated with @override
.
Although, if I'm not mistaken, the example given above does not represent a valid use of @override
.
@override
, as it was just added in Python 3.12, allows explicitly marking a method in a subclass as an override of a method in a superclass. See: https://peps.python.org/pep-0698/.
What the initial comment describes looks to me something like an "overload" of a method. Although I doubt that this would actually work without any third party libraries.
A better example would be:
from typing import override
class Parent:
def foo(self) -> int:
"""My docstring, which I only want to write once for the whole class hierarchy."""
return 1
class Child(Parent):
@override
def foo(self) -> int:
return 2
What a good catch. The overload
is what I actually meant. Somehow, it was transformed into override
. The code (corrected) is how it actually works in Python.
I also came here, since I'm interested in an option to ignore methods decorated with
@override
. Although, if I'm not mistaken, the example given above does not represent a valid use of@override
.
@override
, as it was just added in Python 3.12, allows explicitly marking a method in a subclass as an override of a method in a superclass. See: https://peps.python.org/pep-0698/.What the initial comment describes looks to me something like an "overload" of a method. Although I doubt that this would actually work without any third party libraries.
A better example would be:
from typing import override class Parent: def foo(self) -> int: """My docstring, which I only want to write once for the whole class hierarchy.""" return 1 class Child(Parent): @override def foo(self) -> int: return 2
Hey folks - check out 1.6.0
released today with -O
/ --ignore-overloaded-functions
/ ignore-overloaded-functions = false
. Let me know if you have issues!
Describe the feature you'd like
Consider the following example:
It should be totally valid to have only final method documented and the first two methods to be totally blank on documentation.
Is your feature request related to a problem?
Incorrect documented/undocumented ratio.
Your Environment
interrogate
version(s) (interrogate --version
: 1.5.0Additional context
So, just having something like this (default -
False
), would do the job: