Skip to content

Commit

Permalink
Fix reference API generation of Python properties
Browse files Browse the repository at this point in the history
  • Loading branch information
njroussel committed Jan 27, 2025
1 parent e7652cf commit f2967f1
Show file tree
Hide file tree
Showing 3 changed files with 1,095 additions and 1,251 deletions.
6 changes: 0 additions & 6 deletions docs/docs_api/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,6 @@ def process_docstring_callback(app, what, name, obj, options, lines):
# Don't write class directive twice
if not (what == 'class' and last_class_name == name):
directive_type = what
if what == 'property':
directive_type = 'method'

# Add the corresponding RST directive
directive = '%s.. py:%s:: %s' % (
Expand All @@ -627,10 +625,6 @@ def process_docstring_callback(app, what, name, obj, options, lines):

extracted_rst.append(directive + '\n')

# 'property' fields need an extra argument to the directive
if what == 'property':
extracted_rst.append(doc_indent + ':property:\n')

# 'data' fields get extra arguments
if what == 'data':
extracted_rst.append(doc_indent + ':type: %s\n' % str(type(obj))[8:-2])
Expand Down
Loading

0 comments on commit f2967f1

Please sign in to comment.