diff options
author | Guido van Rossum <guido@python.org> | 2003-01-30 05:39:04 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-01-30 05:39:04 (GMT) |
commit | 45486176ea14884400188c604d5d3488f803ff2d (patch) | |
tree | 1d1015f4e7e6ea85999653e054404a8d39399852 /Lib/idlelib/PyShell.py | |
parent | 301eb71fb9fe45eabdf50763a28925c746403100 (diff) | |
download | cpython-45486176ea14884400188c604d5d3488f803ff2d.zip cpython-45486176ea14884400188c604d5d3488f803ff2d.tar.gz cpython-45486176ea14884400188c604d5d3488f803ff2d.tar.bz2 |
In save_newobj(), if an object's __getnewargs__ and __getstate__ are
the same function, don't save the state or write a BUILD opcode. This
is so that a type (e.g. datetime :-) can support protocol 2 using
__getnewargs__ while also supporting protocol 0 and 1 using
__getstate__. (Without this, the state would be pickled twice with
protocol 2, unless __getstate__ is defined to return None, which
breaks protocol 0 and 1.)
Diffstat (limited to 'Lib/idlelib/PyShell.py')
0 files changed, 0 insertions, 0 deletions