Skip to content

can't unpickle curryied function coming from __main__ #606

@dlovell

Description

@dlovell

if i run

import toolz
from cloudpickle import dumps


@toolz.curry
def f(x, *args, **kwargs):
    return x, args, kwargs

g = f(y=1)
with open("dumped.pkl", "wb") as fh:
    fh.write(dumps(g))

in one python session and then run

from cloudpickle import loads

with open("dumped.pkl", "rb") as fh:
    g = loads(fh.read())

in another python session, i see AttributeError: module '__main__' has no attribute 'f'

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