Skip to content

Recognize dynamic creation of named tuples. #3520

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

Closed
ilevkivskyi opened this issue Jun 9, 2017 · 4 comments
Closed

Recognize dynamic creation of named tuples. #3520

ilevkivskyi opened this issue Jun 9, 2017 · 4 comments

Comments

@ilevkivskyi
Copy link
Member

This appeared in python/typing#427

We can support something like this:

base_fields = [('x', int), ('y', int)]
label = [('label', str)]
LabeledPoint3D = NamedTuple('LabeledPoint3D', base_fields + [('z', int)] + label)
@ilevkivskyi
Copy link
Member Author

We can also do similar things for TypedDict and Enum functional APIs.

@elliott-beach
Copy link
Contributor

elliott-beach commented Jan 15, 2018

Adding this would also fix #4287.

@Dentosal
Copy link

Currently dynamically created enums also show errors, because mypy cannot resolve variants.

@msullivan
Copy link
Collaborator

I don't think we'll do this

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

4 participants