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

Remove datatype() and TypedCollection #8576

Merged
merged 2 commits into from
Nov 5, 2019

Conversation

Eric-Arellano
Copy link
Contributor

@Eric-Arellano Eric-Arellano commented Nov 5, 2019

Resolves #7074. Now that we always use @dataclass instead of datatype, and replaced Collection.of(T) with Collection[T], it is safe to remove datatype().

We also remove TypedCollection as it is no longer in use. Instead, we use explicit type hints like Tuple[str, ...] or Collection[T].

We avoid a deprecation cycle because V2 engine code has always been experimental.

Keeps util/objects.py

We still keep TypeConstraintError, Exactly, SuperclassesOf, and SubclassesOf. These are used widely in the codebase and have no standard library equivalent. They also do not seem to cause problems for MyPy.

Copy link
Contributor

@cosmicexplorer cosmicexplorer left a comment

Choose a reason for hiding this comment

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

I would change the text in the OP to say "resolves #7074" so it can be auto-closed.

@jsirois
Copy link
Contributor

jsirois commented Nov 5, 2019

Although I definitely approve, I'm not as excited as it may appear. There was / is an on-going Github web-hook delivery issue - sorry for the spam.

@Eric-Arellano
Copy link
Contributor Author

Thank you for the reviews and for the original datatype code (especially @cosmicexplorer)!

@Eric-Arellano Eric-Arellano merged commit 08e76b3 into pantsbuild:master Nov 5, 2019
@Eric-Arellano Eric-Arellano deleted the remove-datatype branch November 5, 2019 18:53
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.

merge pants.util.objects.datatype with python 3 dataclasses
4 participants