Skip to content

Commit 92e27a3

Browse files
committed
fix: Fix index error when trying to access the first parameter of functions
Issue #7: #7
1 parent 2381ded commit 92e27a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/griffe_typingdoc/_docstrings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
def _no_self_params(func: Function) -> list[Parameter]:
30-
if func.parent and func.parent.is_class and func.parameters[0].name in {"self", "cls"}:
30+
if func.parent and func.parent.is_class and func.parameters and func.parameters[0].name in {"self", "cls"}:
3131
return list(func.parameters)[1:]
3232
return list(func.parameters)
3333

0 commit comments

Comments
 (0)