summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorms4py <marc.schlaich@googlemail.com>2012-03-16 10:53:34 +0100
committerms4py <marc.schlaich@googlemail.com>2012-03-16 10:53:34 +0100
commit5b9f431fc92fc76c01fcb3b86c02c37298f1c2fc (patch)
tree795780db6dd2418fe47b392cc4e4e71dd3286e1d /sphinx/ext/autodoc.py
parent4713ca78ba4d627644e91c1b7284e967bd7312cd (diff)
downloadsphinx-git-5b9f431fc92fc76c01fcb3b86c02c37298f1c2fc.tar.gz
Changed the ``special-members`` option to behave like the ``members`` option.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 9c6575f52..6c796eec0 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -573,7 +573,11 @@ class Documenter(object):
if want_all and membername.startswith('__') and \
membername.endswith('__') and len(membername) > 4:
# special __methods__
- if self.options.special_members and membername != '__doc__':
+ if self.options.special_members is ALL and \
+ membername != '__doc__':
+ keep = has_doc or self.options.undoc_members
+ elif self.options.special_members and \
+ membername in self.options.special_members:
keep = has_doc or self.options.undoc_members
elif want_all and membername.startswith('_'):
# ignore members whose name starts with _ by default
@@ -748,7 +752,7 @@ class ModuleDocumenter(Documenter):
'show-inheritance': bool_option, 'synopsis': identity,
'platform': identity, 'deprecated': bool_option,
'member-order': identity, 'exclude-members': members_set_option,
- 'private-members': bool_option, 'special-members': bool_option,
+ 'private-members': bool_option, 'special-members': members_option,
}
@classmethod
@@ -949,7 +953,7 @@ class ClassDocumenter(ModuleLevelDocumenter):
'noindex': bool_option, 'inherited-members': bool_option,
'show-inheritance': bool_option, 'member-order': identity,
'exclude-members': members_set_option,
- 'private-members': bool_option, 'special-members': bool_option,
+ 'private-members': bool_option, 'special-members': members_option,
}
@classmethod