python/nondist/sandbox/collections dequemodule.c, 1.3, 1.4 setup.py, 1.1, 1.2 test_deque.py, 1.1, 1.2 timedeque.py, 1.2, 1.3

Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25190 Modified Files: dequemodule.c setup.py test_deque.py timedeque.py Log Message: * Rename the module to "collections". * When moving to the trunk, will also rename the sourcefile to collectionsmodule.c Index: dequemodule.c =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/dequemodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dequemodule.c 26 Jan 2004 18:08:10 -0000 1.3 --- dequemodule.c 27 Jan 2004 01:49:25 -0000 1.4 *************** *** 393,397 **** PyObject_HEAD_INIT(NULL) 0, /* ob_size */ ! "deque.deque", /* tp_name */ sizeof(dequeobject), /* tp_basicsize */ 0, /* tp_itemsize */ --- 393,397 ---- PyObject_HEAD_INIT(NULL) 0, /* ob_size */ ! "collections.deque", /* tp_name */ sizeof(dequeobject), /* tp_basicsize */ 0, /* tp_itemsize */ *************** *** 520,532 **** PyDoc_STRVAR(module_doc, ! "deque collection type.\n\ "); PyMODINIT_FUNC ! initdeque(void) { PyObject *m; ! m = Py_InitModule3("deque", NULL, module_doc); if (PyType_Ready(&deque_type) < 0) --- 520,532 ---- PyDoc_STRVAR(module_doc, ! "High performance data structures\n\ "); PyMODINIT_FUNC ! initcollections(void) { PyObject *m; ! m = Py_InitModule3("collections", NULL, module_doc); if (PyType_Ready(&deque_type) < 0) *************** *** 538,541 **** --- 538,551 ---- return; + /* Note, other types or functions may be added to collections + by importing them from a separate sourcefile module. + For example, to include itertools.izip() in this module: + + othermod = PyImport_ImportModule("itertools"); + otherdict = PyModule_GetDict(othermod); + othertype = PyDict_GetItemString(otherdict, "izip"); + PyModule_AddObject(m, "izip", othertype); + */ + return; } Index: setup.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/setup.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** setup.py 26 Jan 2004 05:25:39 -0000 1.1 --- setup.py 27 Jan 2004 01:49:25 -0000 1.2 *************** *** 1,4 **** from distutils.core import setup, Extension ! setup(name="deque", ! ext_modules=[Extension("deque", ["dequemodule.c"])]) --- 1,4 ---- from distutils.core import setup, Extension ! setup(name="collections", ! ext_modules=[Extension("collections", ["dequemodule.c"])]) Index: test_deque.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/test_deque.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_deque.py 26 Jan 2004 05:25:39 -0000 1.1 --- test_deque.py 27 Jan 2004 01:49:25 -0000 1.2 *************** *** 1,3 **** ! from deque import deque import unittest from test import test_support --- 1,3 ---- ! from collections import deque import unittest from test import test_support Index: timedeque.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/timedeque.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** timedeque.py 26 Jan 2004 17:54:31 -0000 1.2 --- timedeque.py 27 Jan 2004 01:49:25 -0000 1.3 *************** *** 2,6 **** setup = """ ! from deque import deque init = range(100) d = deque(init) --- 2,6 ---- setup = """ ! from collections import deque init = range(100) d = deque(init)
participants (1)
-
rhettingerï¼ projects.sourceforge.net