From 17987fbd9d4245f15cd850b231429802b92b8605 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 8 Oct 2020 12:34:48 +0200 Subject: [PATCH] documentation/python: explicitly test for string type annotations. No surprise expected, just to have that here. --- .../inspect_annotations/inspect_annotations.html | 6 ++++++ .../test_python/inspect_annotations/inspect_annotations.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/documentation/test_python/inspect_annotations/inspect_annotations.html b/documentation/test_python/inspect_annotations/inspect_annotations.html index 2b35cca1..f8275251 100644 --- a/documentation/test_python/inspect_annotations/inspect_annotations.html +++ b/documentation/test_python/inspect_annotations/inspect_annotations.html @@ -101,6 +101,12 @@ def annotation_optional(a: typing.Optional[float])
Annotation with the Optional type
+
+ def annotation_strings(param: typing.List[int], + another: bool, + third: str = 'hello') -> float +
+
Annotated using strings, should result in exactly the same as annotation()
def annotation_tuple_instead_of_tuple(a)
diff --git a/documentation/test_python/inspect_annotations/inspect_annotations.py b/documentation/test_python/inspect_annotations/inspect_annotations.py index 9c848094..11802cb0 100644 --- a/documentation/test_python/inspect_annotations/inspect_annotations.py +++ b/documentation/test_python/inspect_annotations/inspect_annotations.py @@ -34,6 +34,10 @@ def annotation(param: List[int], another: bool, third: str = "hello") -> float: """An annotated function""" pass +def annotation_strings(param: 'List[int]', another: 'bool', third: 'str' = "hello") -> 'float': + """Annotated using strings, should result in exactly the same as annotation()""" + pass + def no_annotation(a, b, z): """Non-annotated function""" pass -- 2.30.2