News for hackers. Stuff that matters.
Re:Python-patterns – A collection of design patterns/idioms ... by tekknolagi on Tuesday May 31, 2022 @02:53AM (#31566771)
You could normally do this with copy.copy or copy.deepcopy but apparently you can't pickle a module object... A quick internet search does not immediately reveal anybody trying to do this before, and I am surprised.
Re:Python-patterns – A collection of design patterns/idioms ... by imurray on Tuesday May 31, 2022 @05:17AM (#31567465)
> apparently you can't pickle a module object

Not with the standard library pickle, but "dill extends python’s pickle module for serializing and de-serializing python objects to the majority of the built-in python types".

— https://pypi.org/project/dill/