4 ms·
They forgot another major problem: You can only reliably unpickle data using the same (or same-enough) code that pickled it. If your class definitions have chan
by meatmanek 4y ago
They forgot another major problem: You can only reliably unpickle data using the same (or same-enough) code that pickled it. If your class definitions have changed or moved around, unpickling can break.
- philsnow 4y agoI ran into a bug in production unpickling some builtins (dicts or sets or something) that were pickled in 2.2 and unpickled in 2.4 (or 2.4 -> 2.6, it's fuzzy). Between those two versions, the exposed 'dunder' methods of whichever builtin changed, and this resulted in unpickled dicts being empty, IIRC.
- kangalioo 4y agoReminds me of C's dumping structs to disk via memcpy
- int_19h 4y agoPickle is far more flexible than that, though, since it's all symbol-based introspection. Adding new attributes etc doesn't break things.
- Spivak 4y agoIf you’re hydrating objects from your JSON you hit the same thing so it’s not as much of a downside as you might think. In fact this is what the benchmark does.