Any private global top-level global levels after a specific naming convention will be included in the Data section generated by Pydoc :
- All normal global variables are displayed there - you can see it simply by running pydoc in a module with some global variables that are otherwise empty.
- βSpecialβ names are displayed (but not private names): names of the type
__SomeClass__ or __a_special_variable__ will be displayed, but names of the type __this_is_private will not be __this_is_private . - Named tuples are displayed , like everything that matches the pattern that defines them: the name of the object begins with
_ , and the object has the _fields attribute (i.e. it has public fields).
There are exceptions to these basic rules; names in the reserved list do not receive the same treatment:
{'__author__', '__builtins__', '__cached__', '__credits__', '__date__', '__doc__', '__file__', '__initializing__', '__loader__', '__module__', '__name__', '__package__', '__path__', '__qualname__', '__slots__', '__version__'}
Pydoc will automatically build separate sections for __version__ , __date__ , __author__ and __credits__ . The rest are "redundant or internal" (for example, __name__ and __package__ are assigned to their own partitions, but Pydoc also automatically generates these fields, whether set or not).
All this can be found by looking at the source , but there seems to be no other place to compile this information - or at least not one that has established itself well on Google.
source share