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

Documented variable in Python class not recognized in subclasses #10242

Open
lelegard opened this issue Aug 18, 2023 · 1 comment
Open

Documented variable in Python class not recognized in subclasses #10242

lelegard opened this issue Aug 18, 2023 · 1 comment
Labels
enhancement a request to enhance doxygen, not a bug Python

Comments

@lelegard
Copy link

Consider a Python class with a documented field. In all subclasses of that base class, the inherited field is not recognized as such. Instead, doxygen considers it as a distinct field for each subclass and complains about the absence of documentation in all subclasses.

## Class
class C1:
    ## Constructor
    def __init__(self):
        ## Variable
        self.a = 'C1'
    ## Method
    def test(self):
        print(self.a)

## Subclass
class C2(C1):
    ## Constructor
    def __init__(self):
        super().__init__()
        self.a = 'C2'

x = C2()
x.test()

Doxygen output:

$ ../doxygen-master/build/bin/doxygen 
test.py:16: warning: Member a (variable) of class test.C2 is not documented.
$
$ ../doxygen-master/build/bin/doxygen --version
1.9.8 (27ba0983fdcc4b7b836e06fef90e05400d8351c8)

In fact, the member a in line 16 of subclass C2 is the inherited member from class C1 which has already been documented as part of C1.

The HTML output for C2 incorrectly lists a field a in addition to the inherited one from C1:
screenshot

Reproduction: doxybug6.zip

@albert-github
Copy link
Collaborator

Currently doxygen does, apparently, not do anything with this overloading in python which results in the fact that the variables a are the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a request to enhance doxygen, not a bug Python
Projects
None yet
Development

No branches or pull requests

2 participants