Commit 2c83511
committed
handle type annotations in nested functions correctly
For example in the following code:
def foo(x: int, y: float):
def bar(q: int):
return q
pass
Make sure that `foo` type annotations are correctly propogated to
it's `__annotate__` and `__annotations__` attributes.
With this chage, we'll get:
>>>>> foo.__annotations__
{'x': <class 'int'>, 'y': <class 'float'>}
Previously annotations where 'lost', and we would get:
>>>>> foo.__annotations__
{}1 parent d79b41b commit 2c83511
2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6707 | 6707 | | |
6708 | 6708 | | |
6709 | 6709 | | |
6710 | | - | |
6711 | 6710 | | |
6712 | 6711 | | |
6713 | 6712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
1139 | | - | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
1140 | 1143 | | |
1141 | 1144 | | |
1142 | 1145 | | |
| |||
0 commit comments