"I don't understand with exec "make" the resulting classes pickle and not type: test.py: TypeClass = type('TypeClass', (object,), {'x': 42}) exec 'class ExecClass(object): x = 42' class NormalClass(object): x = 42 It works fine: >>> import test >>> import pickle >>> pickle.dumps(test.TypeClass()) 'ccopy_reg\n_reconstructor\np0\n(ctest\nTypeClass\np1\nc__builtin__\nobject\np2\nNtp3\nRp4\n.' >>> pickle.dumps(test.ExecClass()) 'ccopy_reg\n_reconstructor\np0\n(ctest\nExecClass\np1\nc__builtin__\nobject\np2\nNtp3\nRp4\n.' >>> pickle.dumps(test.NormalClass()) 'ccopy_reg\n_reconstructor\np0\n(ctest\nNormalClass\np1\nc__builtin__\nobject\np2\nNtp3\nRp4\n.' According to your example, you need to put the 'exec' class in __module__ too."
- Henry Prêcheur
Amazon.com: Founders at Work: Stories of Startups' Early Days (Recipes: a Problem-Solution Ap): Jessica Livingston: Books - http://www.amazon.com/dp...
The Time Paradox: The New Psychology of Time That Will Change Your Life: Amazon.ca: Philip Zimbardo, John Boyd: Books - http://www.amazon.ca/Time-Pa...
Amazon.com: Presentation Zen: Simple Ideas on Presentation Design and Delivery (Voices That Matter): Garr Reynolds: Books - http://www.amazon.com/Present...
Amazon.com: Yes!: 50 Scientifically Proven Ways to Be Persuasive: Noah J. Goldstein, Steve J. Martin, Robert B. Cialdini: Books - https://www.amazon.com/dp...&
Book Review - 'Shop Class as Soulcraft - An Inquiry Into the Value of Work,' by Matthew B. Crawford - Review - NYTimes.com - http://www.nytimes.com/2009...