Skip to content

Instantly share code, notes, and snippets.

@Suor
Created July 16, 2014 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Suor/70c649f09f6d549d18cc to your computer and use it in GitHub Desktop.
Save Suor/70c649f09f6d549d18cc to your computer and use it in GitHub Desktop.
Picklable buffers
# Just two lines anywhere, still copies data before pickling
import copy_reg
copy_reg.pickle(buffer, lambda b: (buffer, (bytes(b),)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment