Skip to content

Picking wrapped classes #117

Open
Open
@rabernat

Description

@rabernat

Thanks for this very useful package! It solves a genuine problem with python's "all or nothing" approach to async programming.

I noticed that the classes produced by Synchronizer.create_blocking are not pickleable, even if the classes they wrap are.

I then had a look at the tests and saw this comment:

@pytest.mark.skip(reason="Let's revisit this in 0.2.0")
def test_pickle():
s = Synchronizer()
BlockingPicklableClass = s.create(PicklableClass, Interface.BLOCKING)
obj = BlockingPicklableClass()
assert obj.f(42) == 1764
data = pickle.dumps(obj)
obj2 = pickle.loads(data)
assert obj2.f(43) == 1849

This makes me think there is some history here...

If I wanted to make my wrapped classes pickleable, could you give me any pointers on where to start?

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