Skip to content

Commit f51bdab

Browse files
author
Jack O'Connor
committed
Add extra test for order of type annotations
1 parent 6f2f5c4 commit f51bdab

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from typing import get_type_hints
2+
3+
def func(s: str) -> int:
4+
return int(s)
5+
6+
hints = get_type_hints(func)
7+
8+
# The order of type hints matters for certain functions
9+
# e.g. functools.singledispatch
10+
assert hints == {'s': str, 'return': int}

0 commit comments

Comments
 (0)