Skip to content

Commit

Permalink
fix: Fix index error when trying to access the first parameter of fun…
Browse files Browse the repository at this point in the history
…ctions

Issue #7: #7
  • Loading branch information
pawamoy committed Oct 23, 2023
1 parent 2381ded commit 92e27a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/griffe_typingdoc/_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


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

Expand Down

0 comments on commit 92e27a3

Please sign in to comment.