This seems to have caused a test failure in astroid project. I am not sure if the fix needs to be done from their end probably relying on some implementation detail or from the patch itself. Feel free to ignore if it's a third-party only error.
Reproducer script : /tmp/namedtuple_astroid.py
from astroid import parse
mod = parse('''from typing import NamedTuple; NamedTuple("A")''')
print(str(next(mod.body[-1].value.infer())))
assert str(next(mod.body[-1].value.infer())) != 'Uninferable'
Before this commit :
python /tmp/namedtuple_astroid.py
Instance of typing.NamedTuple
After this commit :
python /tmp/namedtuple_astroid.py
Uninferable
Traceback (most recent call last):
File "/tmp/namedtuple_astroid.py", line 4, in <module>
assert str(next(mod.body[-1].value.infer())) != 'Uninferable'
AssertionError |