Analysis ignores function decorators
description
Given this code:
def as_list(fn):
. . return lambda: list(fn())
@as_list
def items():
. . yield 1
. . yield 2
. . yield 3
x = items()
print(type(x), x)
The output will be "<type 'list'> [1, 2, 3]", but hovering over x will say it is a generator.
This code is functionally equivalent, but is analysed correctly:
def _items():
. . yield 1
. . yield 2
. . yield 3
items = as_list(_items)
x = items()
print(type(x), x)