Message387222
> but __builtins__.__dict__ cannot be pickled.
I don't see why cloudpickle calls LambdaType() directly. It could use a helper in their cloudpickle.cloudpickle_fast which calls LambdaType() with the proper arguments, especially to get __builtins__. I don't think that cloudpickle should serialize __builtins__!
By the way, I'm not sure why the function constructor builds {'None': None} namespace for builtins rather than inheriting the current builtins namespace. IMO it's unconvenient.
If someone wants to override __builtins__, setting __builtins__ key in the globals namespace should be enough.
> Adding a "builtins" parameter to types.FunctionType() should be be enough.
Oh right, we should give the ability to control this important parameter! |
|
Date |
User |
Action |
Args |
2021-02-18 11:32:58 | vstinner | set | recipients:
+ vstinner, Mark.Shannon, frenzy, pablogsal |
2021-02-18 11:32:58 | vstinner | set | messageid: <1613647978.26.0.583464115137.issue43228@roundup.psfhosted.org> |
2021-02-18 11:32:58 | vstinner | link | issue43228 messages |
2021-02-18 11:32:58 | vstinner | create | |
|