cpython: e4c065b2db49 (original) (raw)

Mercurial > cpython

changeset 82235:e4c065b2db49

Issue #15022: Ensure all pickle protocols are supported. [#15022]

Eric Snow ericsnowcurrently@gmail.com
date Sat, 16 Feb 2013 18:20:32 -0700
parents 05e8d82b19a6
children 65eaac000147
files Lib/test/test_types.py Objects/namespaceobject.c
diffstat 2 files changed, 32 insertions(+), 4 deletions(-)[+] [-] Lib/test/test_types.py 11 Objects/namespaceobject.c 25

line wrap: on

line diff

--- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -1159,10 +1159,15 @@ class SimpleNamespaceTests(unittest.Test def test_pickle(self): ns = types.SimpleNamespace(breakfast="spam", lunch="spam")

def test_main():

--- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -173,6 +173,29 @@ namespace_richcompare(PyObject *self, Py } +PyDoc_STRVAR(namespace_reduce__doc__, "Return state information for pickling"); + +static PyObject * +namespace_reduce(register _PyNamespaceObject *ns) +{

+

+

+} + + +static PyMethodDef namespace_methods[] = {

+}; + + PyDoc_STRVAR(namespace_doc, "A simple attribute-based namespace.\n[](#l2.31) \n[](#l2.32) @@ -207,7 +230,7 @@ PyTypeObject _PyNamespace_Type = { 0, /* tp_weaklistoffset / 0, / tp_iter / 0, / tp_iternext */