Skip to content

Portable pickling of anonymous tuples #78

@daveraja

Description

@daveraja

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions