Local imports do not work for code completion type hinting
Brought to you by:
fabioz
Using assert isinstance(X, Y) does not work for a type Y that was imported into a local scope. For example, the following does not give the variable "param" code complete options:
def foo(param):
import weakref
assert isinstance(param, weakref.ReferenceType)
param.
To contrast, the following DOES work:
import weakref
def foo(param):
assert isinstance(param, weakref.ReferenceType)
param.
It is expected that both code blocks above cause code completion to work.