Skip to content

Commit ed1e59f

Browse files
committed
simplify sentinel check
1 parent e58db8a commit ed1e59f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

sphinx/ext/autodoc/_renderer.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@
88
_ClassDefProperties,
99
_FunctionDefProperties,
1010
)
11-
from sphinx.ext.autodoc._sentinels import (
12-
RUNTIME_INSTANCE_ATTRIBUTE,
13-
SLOTS_ATTR,
14-
SUPPRESS,
15-
UNINITIALIZED_ATTR,
16-
)
11+
from sphinx.ext.autodoc._sentinels import SUPPRESS
1712
from sphinx.locale import _
1813
from sphinx.util import logging
1914

@@ -142,7 +137,7 @@ def _directive_header_lines(
142137

143138
if (
144139
not options.no_value
145-
and props._obj_is_sentinel is not UNINITIALIZED_ATTR
140+
and props._obj_is_sentinel is None # not any sentinel
146141
and not docstrings_has_hide_value
147142
and not props._obj_is_mock
148143
):
@@ -164,8 +159,7 @@ def _directive_header_lines(
164159

165160
if (
166161
not options.no_value
167-
and props._obj_is_sentinel
168-
not in {SLOTS_ATTR, RUNTIME_INSTANCE_ATTRIBUTE, UNINITIALIZED_ATTR}
162+
and props._obj_is_sentinel is None # not any sentinel
169163
and not props._obj_is_attribute_descriptor
170164
and not props._obj_is_generic_alias
171165
and not docstrings_has_hide_value

0 commit comments

Comments
 (0)