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

Add TypedDict to typing_extensions #2940

Merged

Conversation

ilevkivskyi
Copy link
Member

Since there is a PEP for TypedDict (PEP 589), it is being added to typing_extension, see python/typing#628. This PR essentially copies the definition from mypy_extensions.

Corresponding mypy PR python/mypy#6744 can be merged independently of this PR.

@ilevkivskyi ilevkivskyi requested a review from JukkaL April 30, 2019 01:41
def viewvalues(self) -> ValuesView[object]: ...
def __delitem__(self, k: NoReturn) -> None: ...

def TypedDict(typename: str, fields: Dict[str, Type[_T]], total: bool = ...) -> Type[dict]: ...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it return Type[_TypedDict]?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I would say so, but maybe there is a reason why this is bad. @JukkaL, is this intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just discussed this and decided it should be just object, because it is a magic special object like TypeVar.

Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge this after the typing PR has been merged.

@ilevkivskyi ilevkivskyi merged commit d61635e into python:master May 7, 2019
@ilevkivskyi ilevkivskyi deleted the copy-typed-dict-typing-extensions branch May 7, 2019 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants