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

Implement JSON DataFile serialization #611

Merged
merged 32 commits into from Dec 28, 2022
Merged

Conversation

lieryan
Copy link
Member

@lieryan lieryan commented Dec 16, 2022

Description

Make ScopeInfo JSON-serializable: there are some data here that are python class instances, but they really doesn't need to be, we can just __getstate__()/__setstate__() them instead when de/serializing.

This PR doesn't implement reading from the JSON files yet. Rope is currently still only reading out from the existing pickle files.

Part of the series: #605

Checklist (delete if not relevant):

  • I have added tests that prove my fix is effective or that my feature works
  • I have updated CHANGELOG.md

It's easier to parse this because `json.loads(object_hook)` exists, but
there's no `json.loads(array_hook)`
Now that tuple encoding is no longer being overloaded with list, this
can become much simpler.
@lieryan lieryan added this to the 1.7.0 milestone Dec 19, 2022
Parenthesised context manager isn't supported until Python 3.10 and up
(and unofficially, since Python 3.9).
@lieryan lieryan merged commit b38d82e into master Dec 28, 2022
@lieryan lieryan deleted the lieryan-implement-json-datafile branch December 28, 2022 05:52
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.

None yet

1 participant