commit | 45486176ea14884400188c604d5d3488f803ff2d | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Thu Jan 30 05:39:04 2003 +0000 |
committer | Guido van Rossum <guido@python.org> | Thu Jan 30 05:39:04 2003 +0000 |
tree | 1d1015f4e7e6ea85999653e054404a8d39399852 | |
parent | 301eb71fb9fe45eabdf50763a28925c746403100 [diff] |
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.)