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

Portable pickling of anonymous tuples #78

Open
daveraja opened this issue Feb 1, 2022 · 0 comments
Open

Portable pickling of anonymous tuples #78

daveraja opened this issue Feb 1, 2022 · 0 comments

Comments

@daveraja
Copy link
Collaborator

daveraja commented Feb 1, 2022

Pull request #75 adds pickling of anonymous tuples. But it uses sys._getframe() which is an cpython specific implementation function. So to support a more portable approach need to look at alternatives. The idea is to transform the anonymous tuple into a normal tuple during the pickling process (in the Predicate.__setstate__() function )and during unpickling (in the Predicate.__getstate__() function), turn the tuple back into the appropriate anonymous tuple.

Note: I think this idea should work for anonymous tuples that are part of an otherwise pickleable predicate sub-class definition. However, it would not solve the problem for other dynamically generated predicate sub-classes, such as using the simple_predicate() function.

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

No branches or pull requests

1 participant