Understanding namespace documentation

I am trying to understand how doxygen works with namespaces in Python. By default, the namespace of the name "file name" is created, i.e. temp.py. I can also declare new namespaces using the \packageor command \namespace.

However, what I don’t understand is why the class below (or any other definition) always appears in the namespace temp?

Please help me understand how the namespace command in doxygen works.

If you know how and why the / namespace pr / package commands are used in doxygen, you can bypass the example below and directly answer it.

#filename = temp.py
##\mainpage Main Page Title
#\brief main page title comments  \n




## class class_demo1 \n
#  the class declared below \n
class class_demo1:
        pass

from new_package import *

Now I am adding a new namespace named \ new_package added to temp.py

##\package new_package
#new namespace comments \n

\new_package.py :

def demo_fun:
    pass

class demo_class:
    pass

\class_demo1 \temp. \new_package.py def, .

+5
1

Demo new_package, new_package.temp:

new_package/
├── __init__.py#   from .temp import Demo
└── temp.py
    #   class Demo:
    #       pass

doxygen , .

+2

All Articles