Skip to content

Commit 3095502

Browse files
author
Victoria Hall
committed
docs
1 parent 7cbabd6 commit 3095502

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

azure/functions/meta.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import sys
1010

1111
from typing import Dict, Optional, Union, Tuple, Mapping, Any
12-
if sys.version_info >= (3, 8):
12+
if sys.version_info >= (3, 9):
1313
from typing import get_origin, get_args
1414
else:
1515
from ._thirdparty.typing_inspect import get_origin, get_args
@@ -22,10 +22,14 @@
2222

2323

2424
def is_iterable_type_annotation(annotation: object, pytype: object) -> bool:
25+
"""Since python 3.9, standard collection types are supported in type hint.
26+
origin is the unsubscripted version of a type (eg. list, union, etc.).
27+
28+
If origin is not None, then the type annotation is a builtin or part of
29+
the collections class.
30+
"""
2531
origin = get_origin(annotation)
2632
if sys.version_info >= (3, 9):
27-
# Since python 3.9, standard collection types
28-
# are supported in type hint
2933
is_iterable_anno = (origin is not None
3034
and issubclass(origin, collections.abc.Iterable))
3135
else:

0 commit comments

Comments
 (0)