Skip to content

Commit 0b8ee53

Browse files
authored
fix type hints in examples (robotframework#3894)
Co-authored-by: KotlinIsland <kotlinisland@users.noreply.github.com>
1 parent fbae73a commit 0b8ee53

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎doc/userguide/src/ExtendingRobotFramework/CreatingTestLibraries.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ has multiple possible types is using Union_:
15531553
from typing import Union
15541554

15551555

1556-
def example(length=Union[int, float], padding=[None, int, str]):
1556+
def example(length: Union[int, float], padding: Union[None, int, str]):
15571557
# ...
15581558

15591559
An alternative is giving types a tuple. It is not recommended with annotations
@@ -1587,7 +1587,7 @@ would get the original given argument:
15871587

15881588
.. sourcecode:: python
15891589

1590-
def example(argument=Union[int, MyCustomType]):
1590+
def example(argument: Union[int, MyCustomType]):
15911591
# ...
15921592

15931593
.. _Union: https://docs.python.org/3/library/typing.html#typing.Union

0 commit comments

Comments
 (0)