Mark Shannon <m...@hotpy.org> added the comment:

Do you have a reproducer that does not use cloudpickle?

Pickling functions seems to work correctly.

>>> import pickle
>>> def func():
...     return len([])
... 
>>> func2 = pickle.loads(pickle.dumps(func))
>>> 
>>> func2()
0

How is cloudpickle supposed to work? It looks like the globals dict passed to 
FunctionType(...) lacks a __builtins__.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43228>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to