Skip to content

Commit

Permalink
add special case for member_descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
mivanit committed Aug 19, 2024
1 parent 3ceaf8b commit 9f7a9f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pdoc/html_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,10 @@ def format_git_link(template: str, dobj: pdoc.Doc):
obj = obj.fget
elif isinstance(obj, cached_property):
obj = obj.func
elif hasattr(obj, '__class__') and obj.__class__.__name__ == '_tuplegetter':
# This is a NamedTuple field
elif (
(hasattr(obj, '__class__') and obj.__class__.__name__ == '_tuplegetter')
or inspect.ismemberdescriptor(obj)
):
class_name = dobj.qualname.rsplit('.', 1)[0]
obj = getattr(dobj.module.obj, class_name)

Expand Down

0 comments on commit 9f7a9f4

Please sign in to comment.