From 9732d96cda61952e0b050212a459bed9e1d1ccb7 Mon Sep 17 00:00:00 2001 From: Dan Lee Date: Fri, 9 Aug 2024 06:13:48 +0000 Subject: [PATCH] fix: update offset with kwonlydefaults included --- docfx_yaml/extension.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docfx_yaml/extension.py b/docfx_yaml/extension.py index b25b49c..0ae3726 100644 --- a/docfx_yaml/extension.py +++ b/docfx_yaml/extension.py @@ -991,6 +991,8 @@ def _update_friendly_package_name(path): # Find the first index which default arguments start at. # Every argument after this offset_count all have default values. offset_count = len(argspec.defaults) + if argspec.kwonlydefaults: + offset_count += len(argspec.kwonlydefaults) # Find the index of the current default value argument index = len(args) + count - offset_count