classmethods documented as a static method
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
Expected Behavior

Actual Behavior

Steps to Reproduce
Example code:
import documentation_test.submod1.submod1 as submod1
import documentation_test.submod2.submod2 as submod2
__all__ = ['testFunction', 'testClass']
class testClass(object):
"""Summary of class
Attributes
----------
arg : str
a string to print
"""
def __init__(self, arg: str):
"""Summary of init
Parameters
----------
arg : str, optional
a string to print
"""
super(testClass, self).__init__()
self.arg = arg
@classmethod
def createString(cls, aString: str):
"""create a string
Parameters
----------
aString : str
a string to print
"""
return cls(arg=aString)
def printString(self):
"""Print a string
"""
print(self.arg)
def testFunction(anything: str = 'test') -> None:
"""test function for a demo import of whole module
Parameters
----------
anything : str, optional
a test string
Returns
-------
None
"""
print(anything)
submod1.submod1('string from submod1 in base')
submod2.submod2('string from submod2 in base')
Command ran: pdoc --config show_type_annotations=True --html src/documentation_test --force
Additional info
- pdoc version: 0.7.2
- python 3.8
Not sure if this is intentional or I have done something nonstandard. No matter what I try; class in a submodule, class with both static and class methods, etc. I get the same result.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the output with the example package under src/documentation_test using pdoc --config show_type_annotations=True --html src/documentation_test --force. Compare how the generated documentation labels createString with the expected and actual results, then trace the relevant class-member handling. Done means classmethods are documented as class methods rather than static methods, with regression coverage for the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100