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

Unpacking NamedTuples gives Any type #907

Closed
yellowjello opened this issue Aug 1, 2020 · 2 comments
Closed

Unpacking NamedTuples gives Any type #907

yellowjello opened this issue Aug 1, 2020 · 2 comments
Labels
addressed in next version Issue is fixed and will appear in next published version enhancement request New feature or request

Comments

@yellowjello
Copy link

Is your feature request related to a problem? Please describe.
Currently unpacking NamedTuples results in Any type for the unpacked elements.

Example:

from typing import NamedTuple

class Something(NamedTuple):
    blah: str
    hah: int

ntpl = Something("yes", 1)

(a, b) = ntpl # a and b are Any

Describe the solution you'd like
It would be great if the behavior is the same as unpacking regular tuples where it gives the types of the unpacked elements.

@yellowjello yellowjello added the enhancement request New feature or request label Aug 1, 2020
@erictraut
Copy link
Collaborator

This is related to #860.

@erictraut erictraut added as designed Not a bug, working as intended and removed as designed Not a bug, working as intended labels Aug 1, 2020
@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label Aug 14, 2020
@erictraut
Copy link
Collaborator

This is now addressed in version 1.1.63 of Pyright, which I just published. It will also be in the next release of Pylance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version enhancement request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants