Message375105
| Author | serhiy.storchaka |
|---|---|
| Recipients | gvanrossum, levkivskyi, serhiy.storchaka, xtreak |
| Date | 2020-08-10.09:37:33 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1597052253.54.0.383520902416.issue40185@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
$ 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. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2020-08-10 09:37:33 | serhiy.storchaka | set | recipients: + serhiy.storchaka, gvanrossum, levkivskyi, xtreak |
| 2020-08-10 09:37:33 | serhiy.storchaka | set | messageid: <1597052253.54.0.383520902416.issue40185@roundup.psfhosted.org> |
| 2020-08-10 09:37:33 | serhiy.storchaka | link | issue40185 messages |
| 2020-08-10 09:37:33 | serhiy.storchaka | create | |