We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15d322f commit 3ceaf8bCopy full SHA for 3ceaf8b
pdoc/html_helpers.py
@@ -566,11 +566,15 @@ def format_git_link(template: str, dobj: pdoc.Doc):
566
commit = _git_head_commit()
567
obj = dobj.obj
568
569
- # special handlers for properties and cached_properties
+ # special handlers for properties, cached_properties, and tuples
570
if isinstance(obj, property):
571
obj = obj.fget
572
elif isinstance(obj, cached_property):
573
obj = obj.func
574
+ elif hasattr(obj, '__class__') and obj.__class__.__name__ == '_tuplegetter':
575
+ # This is a NamedTuple field
576
+ class_name = dobj.qualname.rsplit('.', 1)[0]
577
+ obj = getattr(dobj.module.obj, class_name)
578
579
abs_path = inspect.getfile(inspect.unwrap(obj))
580
path = _project_relative_path(abs_path)
0 commit comments