Skip to content

Remove annotations for python3.6 and below - #197

Merged
ogrisel merged 3 commits into
cloudpipe:masterfrom
cicdw:annotations-fix
Sep 19, 2018
Merged

Remove annotations for python3.6 and below#197
ogrisel merged 3 commits into
cloudpipe:masterfrom
cicdw:annotations-fix

Conversation

@cicdw

@cicdwcicdw commented Sep 6, 2018

Copy link
Copy Markdown
Contributor

Closes#193 and closes#196 with a heavy hand, by removing the ability to include __annotations__ in versions of python < 3.7.

It seemed the ability to pickle arbitrary typing classes was a deep rabbit hole external to cloudpickle, and AFAIK the alternative would be some sort of check / try / except on annotations that would lead to inconsistent pickling of __annotations__.

@ogrisel

Copy link
Copy Markdown
Contributor

I have no strong opinion. I believe it's ok to remove a half broken half working feature. We should probably do it as part of 0.6 and document that well in the changelog.

@ogrisel

Copy link
Copy Markdown
Contributor

I pinged several reviewers to get a second opinion on this change.

@pitrou

Copy link
Copy Markdown
Member

Agreed with this. It's unfortunate that typing was designed in such a baroque and unusual way. Not the greatest Python feature IMO :-/

@mrocklin

Copy link
Copy Markdown
Contributor

No objection from me. I don't know this topic well though. I'm inclined to trust @pitrou .

@ogrisel

Copy link
Copy Markdown
Contributor

@cicdw can you please add an entry to document this change to the change log file?

@cicdw

Copy link
Copy Markdown
ContributorAuthor

@ogrisel yup, done.

@codecov-io

codecov-io commented Sep 19, 2018

Copy link
Copy Markdown

Codecov Report

Merging #197 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@## master #197 +/- ##
=======================================
Coverage 85.16% 85.16% =======================================
Files 1 1 Lines 573 573 Branches 111 111 =======================================
Hits 488 488 Misses 62 62 Partials 23 23
Impacted FilesCoverage Δ
cloudpickle/cloudpickle.py85.16% <100%> (ø)⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d73b39...3e51437. Read the comment docs.

@ogrisel

Copy link
Copy Markdown
Contributor

Alright, let's merge then! Thanks @cicdw.

Sign up for freeto 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.

typing.Generic-based type annotations cannot be loaded Pickling Annotations can fail

5 participants

@cicdw@ogrisel@pitrou@mrocklin@codecov-io