From eb9798892d7ed54762ae006e39db0a84f671cfd3 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 28 Feb 2007 18:37:52 +0000 Subject: [PATCH] Prepare collections module for pure python code entries. --- Lib/collections.py | 3 +++ Modules/{collectionsmodule.c => _collectionsmodule.c} | 4 ++-- PC/config.c | 4 ++-- PCbuild/pythoncore.vcproj | 2 +- PCbuild8/pythoncore.vcproj | 2 +- setup.py | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 Lib/collections.py rename Modules/{collectionsmodule.c => _collectionsmodule.c} (99%) diff --git a/Lib/collections.py b/Lib/collections.py new file mode 100644 index 00000000000..0d9254c9a74 --- /dev/null +++ b/Lib/collections.py @@ -0,0 +1,3 @@ +__all__ = ['deque', 'defaultdict'] + +from _collections import deque, defaultdict diff --git a/Modules/collectionsmodule.c b/Modules/_collectionsmodule.c similarity index 99% rename from Modules/collectionsmodule.c rename to Modules/_collectionsmodule.c index f98bd490323..c37f9ace157 100644 --- a/Modules/collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1337,11 +1337,11 @@ PyDoc_STRVAR(module_doc, "); PyMODINIT_FUNC -initcollections(void) +init_collections(void) { PyObject *m; - m = Py_InitModule3("collections", NULL, module_doc); + m = Py_InitModule3("_collections", NULL, module_doc); if (m == NULL) return; diff --git a/PC/config.c b/PC/config.c index a9a280ded10..e1b52a4f232 100644 --- a/PC/config.c +++ b/PC/config.c @@ -43,7 +43,7 @@ extern void initxxsubtype(void); extern void initzipimport(void); extern void init_random(void); extern void inititertools(void); -extern void initcollections(void); +extern void init_collections(void); extern void init_heapq(void); extern void init_bisect(void); extern void init_symtable(void); @@ -124,7 +124,7 @@ struct _inittab _PyImport_Inittab[] = { {"_heapq", init_heapq}, {"_lsprof", init_lsprof}, {"itertools", inititertools}, - {"collections", initcollections}, + {"_collections", init_collections}, {"_symtable", init_symtable}, {"mmap", initmmap}, {"_csv", init_csv}, diff --git a/PCbuild/pythoncore.vcproj b/PCbuild/pythoncore.vcproj index 9f59cf42e3e..50e51f7aeed 100644 --- a/PCbuild/pythoncore.vcproj +++ b/PCbuild/pythoncore.vcproj @@ -458,7 +458,7 @@ RelativePath="..\Objects\codeobject.c"> + RelativePath="..\Modules\_collectionsmodule.c"> diff --git a/PCbuild8/pythoncore.vcproj b/PCbuild8/pythoncore.vcproj index f3358792fb6..16a250e5fce 100644 --- a/PCbuild8/pythoncore.vcproj +++ b/PCbuild8/pythoncore.vcproj @@ -1381,7 +1381,7 @@ >