Skip to content

Commit f878e5d

Browse files
committed
Updated PythonLibCore for method self typing hints
1 parent 1d8e855 commit f878e5d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/SeleniumLibrary/base/robotlibcore.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ def __get_typing_hints(self, method):
145145
except Exception:
146146
hints = method.__annotations__
147147
hints.pop('return', None)
148+
spec = ArgumentSpec.from_function(method)
149+
for arg in hints.copy():
150+
# Drop self
151+
if arg not in spec.positional and arg not in spec.kwonlyargs:
152+
hints.pop(arg)
148153
return hints
149154

150155
def __join_defaults_with_types(self, method, types):

0 commit comments

Comments
 (0)