diff --git a/pep-0307.txt b/pep-0307.txt index cd7a05306..ad37ecd2a 100644 --- a/pep-0307.txt +++ b/pep-0307.txt @@ -36,9 +36,7 @@ Introduction Motivation Pickling new-style objects causes serious pickle bloat. For - example, the binary pickle for a classic object with one instance - variable takes up 33 bytes; a new-style object with one instance - variable takes up 86 bytes. This was measured as follows: + example, class C(object): # Omit "(object)" for classic class pass @@ -46,6 +44,9 @@ Motivation x.foo = 42 print len(pickle.dumps(x, 1)) + The binary pickle for the classic object consumed 33 bytes, and for + the new-style object 86 bytes. + The reasons for the bloat are complex, but are mostly caused by the fact that new-style objects use __reduce__ in order to be picklable at all. After ample consideration we've concluded that