diff options
author | Guido van Rossum <guido@python.org> | 2003-01-30 05:39:04 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-01-30 05:39:04 +0000 |
commit | 45486176ea14884400188c604d5d3488f803ff2d (patch) | |
tree | 1d1015f4e7e6ea85999653e054404a8d39399852 /Python/modsupport.c | |
parent | 301eb71fb9fe45eabdf50763a28925c746403100 (diff) | |
download | cpython-git-45486176ea14884400188c604d5d3488f803ff2d.tar.gz |
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 'Python/modsupport.c')
0 files changed, 0 insertions, 0 deletions