You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using typing hints or keyword-only-arguments prevents using function as keyword #2627
Then I will import this library in typing.robot like below:
*** Settings ***
Library typing
*** Test Cases ***
Typing Check
No typing hint hint
Typing hint hint
Finally, exception throws with no keyword named 'Typing hint' found.
Seems like in argumentsparser.py, a deprecated method called getargspec is the root cause. My guess is this method is unable to analyze the new syntax.
classPythonArgumentParser(_ArgumentParser):
def_get_arg_spec(self, handler):
args, varargs, kwargs, defaults=inspect.getargspec(handler) # here, replace this with the new method getfullargspec().ifinspect.ismethod(handler) orhandler.__name__=='__init__':
args=args[1:] # drop 'self'defaults=list(defaults) ifdefaultselse []
returnargs, defaults, varargs, kwargs
I have submit a pull request #2625 to fix this issue.
changed the title [-]No keyword error is raised when call the function with typing hint[/-][+]Using typing hints prevents using function as keyword[/+]on Jun 28, 2017
changed the title [-]Using typing hints prevents using function as keyword[/-][+]Using typing hints or keyword-only-arguments prevents using function as keyword[/+]on Feb 23, 2018
Activity
[-]No keyword error is raised when call the function with typing hint[/-][+]Using typing hints prevents using function as keyword[/+]pekkaklarck commentedon Jun 28, 2017
This is somewhat related to keyword-only-arguments support covered by issue #2555.
Kompakti commentedon Jan 19, 2018
I'll start to work on this.
Allow using python3 keywords with parameter annotations. Fixes robotf…
Add tests for using python3 keywords with parameter annotations. Comp…
Add tests for using python3 keywords with parameter annotations. Comp…
[-]Using typing hints prevents using function as keyword[/-][+]Using typing hints or keyword-only-arguments prevents using function as keyword[/+]pekkaklarck commentedon Feb 23, 2018
This has been fixed by PR #2751.