Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

$ echo 'from typing import NamedTuple; NamedTuple("A")' | ./python -m ast
Module(
   body=[
      ImportFrom(
         module='typing',
         names=[
            alias(name='NamedTuple')],
         level=0),
      Expr(
         value=Call(
            func=Name(id='NamedTuple', ctx=Load()),
            args=[
               Constant(value='A')],
            keywords=[]))],
   type_ignores=[])

So mod.body[-1].value is a call:

    Call(func=Name(id='NamedTuple', ctx=Load()), args=[Constant(value='A')], 
keywords=[])

I do not know what Astroid does with this node, but seem the problem is in its 
infer() method.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40185>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to