Skip to content
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

Explicitly treat ObjectDescription._doc_field_type_map as an instance variable #6482

Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions sphinx/directives/__init__.py
Expand Up @@ -73,15 +73,14 @@ class ObjectDescription(SphinxDirective):
def get_field_type_map(self):
# type: () -> Dict[str, Tuple[Field, bool]]
if self._doc_field_type_map == {}:
self._doc_field_type_map = {}
for field in self.doc_field_types:
ViktorHaag marked this conversation as resolved.
Show resolved Hide resolved
for name in field.names:
self._doc_field_type_map[name] = (field, False)

ViktorHaag marked this conversation as resolved.
Show resolved Hide resolved
if field.is_typed:
typed_field = cast(TypedField, field)
for name in typed_field.typenames:
self._doc_field_type_map[name] = (field, True)

return self._doc_field_type_map

def get_signatures(self):
Expand Down