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

Support pickling of extension classes #7481

Merged
merged 3 commits into from Sep 9, 2019
Merged

Support pickling of extension classes #7481

merged 3 commits into from Sep 9, 2019

Conversation

msullivan
Copy link
Collaborator

@msullivan msullivan commented Sep 7, 2019

This operates by providing default implementations of __getstate__
and __setstate__ for extension classes. Our implementations work by
storing a __mypyc_attrs__ tuple in each class that we generate and
collecting all of the attributes in it into a dict.

This is is the last big obstacle to supporting black well.

Fixes mypyc/mypyc#697.

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

Thanks! Looks very good. I just have couple small suggestions.

mypyc/test-data/run-classes.test Outdated Show resolved Hide resolved
mypyc/genops.py Outdated Show resolved Hide resolved
This operates by providing default implementations of `__getstate__`
and `__setstate__` for extension classes. Our implementations work by
storing a `__mypyc_attrs__` tuple in each class that we generate and
collecting all of the attributes in it into a dict.

Fixes #697.
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.

Support pickling of extension classes
2 participants