Skip to content

Make dataclasses availible as a backported third_party library. #2354

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

Merged
merged 2 commits into from
Aug 7, 2018
Merged

Make dataclasses availible as a backported third_party library. #2354

merged 2 commits into from
Aug 7, 2018

Conversation

garyvdm
Copy link
Contributor

@garyvdm garyvdm commented Aug 1, 2018

This fixes python/mypy#5389, and implements the fix suggested by @gvanrossum

I have manually tested the change, and it fixes the issue for me.

I'm not sure if there is a way to write a automated test for the change?

I have not requested permission from the library owner, as I am assuming that this is not necessary for stdlib backports.

@dsully
Copy link

dsully commented Aug 1, 2018

+1 - thanks!

@JelleZijlstra
Copy link
Member

Could you add this to tests/check_consistent.py to make sure that the backport and the stdlib version stay in sync?

@garyvdm
Copy link
Contributor Author

garyvdm commented Aug 1, 2018 via email


class InitVar(Generic[_T]): ...

def make_dataclass(cls_name: str, fields: Iterable[Union[str, Tuple[str, type], Tuple[str, type, Field[Any]]]], *,
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that mypy was complaining to me about this one the other day. I generally run with --strict and mypy is unhappy with the implied Any return value here.

yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this pull request Jan 23, 2019
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.

Request for dataclass backport support in 3.6 (using 3.6.6).
4 participants