Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Support pickling dynamic classes subclassing
typing.Generic
instances on 3.7+ #351Support pickling dynamic classes subclassing
typing.Generic
instances on 3.7+ #351Changes from all commits
7b4bb6d
7fd4412
d67aad0
20a8835
59e648e
dc25224
82b5f31
5326c8c
43ef753
6854502
5791b84
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name used in this test is a little bit confusing: are we testing classes inheriting from
Generic
constructs, or the pickling ofGeneric
type hints? It seems like we are testing both, and I am not sure why we should test both things in the same tests. See my comments below for additional remarks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I my initial commit, this test was testing for all kinds of type annotations, both simple literal types and more complex custom types based on generics and their subclasses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make things clear: pickling
Generic
constructs works fine on master right now. The only thing this PR introduces is supporting the pickling of dynamic classes defined using thesemantic. the type hint used in
attribute
as well as inmethod
is correctly pickled (forPython 3.7+
) incloudpickle
master as of now. I think adding such type hints in this tests generates more confusion that it helps.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but it was not properly tested. So better take the opportunity to increase the test coverage in general, not just the specific fix from this PR.