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'