You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
NamedTuple with no fields causes "object" not callable error #1276
I think the type_map is storing NameExpr(NamedTuple [typing.NamedTuple]) as an object, and it looks like the in the latter case it's skipping a check . . . I remember reading in an issue that NamedTuple wasn't fully supported, so I assume that's what's going on.
I think I know what this is. Because there are no items, the code here thinks there's an error. It then skips the assignment to call.analyzed a few lines later. Maybe it can be fixed by changing "return" to "info =" in the error branch.
FWIW the thing you noted with using a variable for the list of fields is unrelated -- it's a general thing that mypy doesn't understand dynamically constructed types.
Activity
gvanrossum commentedon Mar 6, 2016
I think I know what this is. Because there are no items, the code here thinks there's an error. It then skips the assignment to
call.analyzeda few lines later. Maybe it can be fixed by changing "return" to "info =" in the error branch.gvanrossum commentedon Mar 6, 2016
FWIW the thing you noted with using a variable for the list of fields is unrelated -- it's a general thing that mypy doesn't understand dynamically constructed types.