Open
Description
Steps to reproduce
import astroid
code = """
class Test:
def __getitem__(self, key):
if key == 1:
return 42
else:
return None
x = Test()
result = x[42] #@
"""
node = astroid.extract_node(code)
x = node.value.inferred()
print(x)
Current behavior
Only int
is inferred:
[<Const.int l.5 at 0x7fffe8958640>]
Expected behavior
I expect to see both int
and None
as possible values.
python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"
output
2.7.3