-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use of \protected \private commands with python #6554
Comments
Can you please attach a, small, complete self contained example (source+config file in a tar or zip) that allows us to reproduce the problem? |
I created the attached project with a single class Test based on my previous comment (with generated doc and Doxyfile). |
Looks like there are 2 problems:
I found a reference (in an answer) of what should be protected and private (https://stackoverflow.com/questions/797771/python-protected-attributes) but is there an authoritative source with this type of information? |
Thank you for your quick answer but
I thought \protected and \private instructions work for python. Aren't they? |
As far as I can see at the moment At the moment I think the only thing you can do is to use |
Is there any fix planned for that? from this issue #1996 I thought i was supposed to be implemented since version 1.4.7. |
This is the reason why we now see that the methods with an underscore is private (unless starting and ending with 2 underscores).
|
ok so the fact is that \private and \protected are not handled in python is a doxygen bug? |
I'm a bit reluctant to say that it is a bug in doxygen. In Python when no When looking at Fortran we have here a similar situation (see attachment In C++ we don't have this situation, as far as I know, as we can only set globally a protection and not per individual variable / function (unless of course putting 'public:' or 'private:' just in front of it but this is not on a variable but on the following section), so here the comment protection setting overrules always the default / section setting. @doxygen what is your opinion about this: should the attribute setting (Python underscore, Fortran attribute) or the comment ( |
OK I understand now. I will try the \cond statements to see i can find a workaround. |
Python does not have a real knowledge of protection in respect to variables and functions (i.e. public / private / protected). There are some ad-hoc rules but they changed over time as well. Doxygen uses some build in settings for protection i.e. methods starting with '__' and ending with '__' are public other variables and methods starting with '_' are private. This change makes it possible for the user to define his own rules for the protection within Python. (Loosely based on issue doxygen#6554)
I've just pushed a pull request for a more flexible definition of the protection within Python, pull request #6555. |
Thank you for your support. |
In somme classes I want to hide the init method /constructor because I implement a singleton. On others I want to make protected methods visible (methods starting with an underscore)
To achieve that, I am trying to use the \protected and \private commands but without success. The init method i still present in generated doc and the protected method is still absent. What am I missing?
When exploring the issues, I thought this should be working since version 1.4.7 and I am using 1.8.14
The text was updated successfully, but these errors were encountered: