Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

namedtuple does not support additional arguments #2127

Closed
elazarg opened this issue Sep 13, 2016 · 5 comments
Closed

namedtuple does not support additional arguments #2127

elazarg opened this issue Sep 13, 2016 · 5 comments

Comments

@elazarg
Copy link
Contributor

elazarg commented Sep 13, 2016

$ cat > tmp.py
from collections import namedtuple
T = namedtuple('T', 'a b', verbose=True, rename=False)
$ mypy tmp.py
tmp.py:2: error: Too many arguments for namedtuple()
tmp.py:2: error: "object" not callable

Related: typeshed #541

@gvanrossum
Copy link
Member

Thanks for the report -- since you refactored this code yourself recently I presume you know where to fix it!

@JelleZijlstra
Copy link
Member

I'm working on a fix for this and #2124.

@snstanton
Copy link

The same error is reported for typing.NamedTuple, which supports arbitrary named parameters. Will the fix for collections.namedtuple address typing.NamedTuple?

@emmatyping
Copy link
Collaborator

#4788 depends on this so raising priority to high.

@JelleZijlstra
Copy link
Member

Fixed by #5215.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants