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
Close #4257: autodoc: Add autodoc_class_signature #9171
Conversation
fb3f3e0
to
59b2830
Compare
db60c7b
to
7f16b82
Compare
Add `autodoc_class_signature` to separate the class entry and the definition of `__init__()` method.
7f16b82
to
51ae283
Compare
if self.options.special_members is None: | ||
self.options['special-members'] = {'__new__', '__init__'} | ||
else: | ||
self.options.special_members.append('__new__') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean .add
instead of .append
here and in class _All
? I tried to build my project documentation with the new autodoc_class_signature
option (sphinx installed from github master) and got
# ... snip ...
File "/home/ruro/projects/personal/aside/.venv/lib/python3.6/site-packages/sphinx/ext/autodoc/directive.py", line 162, in run
documenter.generate(more_content=self.content)
File "/home/ruro/projects/personal/aside/.venv/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 976, in generate
self.document_members(all_members)
File "/home/ruro/projects/personal/aside/.venv/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 850, in document_members
documenter = classes[-1](self.directive, full_mname, self.indent)
File "/home/ruro/projects/personal/aside/.venv/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 1452, in __init__
self.options.special_members.append('__new__')
AttributeError: 'set' object has no attribute 'append'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops... you're right. Could you file an issue or pull request, please?
Feature or Bugfix
Purpose
autodoc_class_signature
to separate the class entry and thedefinition of
__init__()
method.autoclass
#4257