Using copyreg to pickle unpicklable oblects

kerbingamer376 martinjp376 at gmail.com
Mon Sep 19 11:40:56 EDT 2016


Hi,
I have an object (pygame.mixer.Sound) and, to convert it to a picklable format, I can run:

sound_object.get_raw()

and to turn that back into an object, I can run:

sound_object = pygame.mixer.Sound(raw_data)

Is it possible to use copyreg or something similar so it's done automatically when I pickle pygame.mixer.Sound() objects?



More information about the Python-list mailing list