summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-02-28 18:37:52 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-02-28 18:37:52 (GMT)
commiteb9798892d7ed54762ae006e39db0a84f671cfd3 (patch)
tree629823599716e83c322e7a9799a644d4a2b616a9
parent3035d2397f4a6d028d7b1f87563c649457d5cbb4 (diff)
downloadcpython-eb9798892d7ed54762ae006e39db0a84f671cfd3.zip
cpython-eb9798892d7ed54762ae006e39db0a84f671cfd3.tar.gz
cpython-eb9798892d7ed54762ae006e39db0a84f671cfd3.tar.bz2
Prepare collections module for pure python code entries.
-rw-r--r--Lib/collections.py3
-rw-r--r--Modules/_collectionsmodule.c (renamed from Modules/collectionsmodule.c)4
-rw-r--r--PC/config.c4
-rw-r--r--PCbuild/pythoncore.vcproj2
-rw-r--r--PCbuild8/pythoncore.vcproj2
-rw-r--r--setup.py2
6 files changed, 10 insertions, 7 deletions
diff --git a/Lib/collections.py b/Lib/collections.py
new file mode 100644
index 0000000..0d9254c
--- /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
index f98bd49..c37f9ac 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 a9a280d..e1b52a4 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 9f59cf4..50e51f7 100644
--- a/PCbuild/pythoncore.vcproj
+++ b/PCbuild/pythoncore.vcproj
@@ -458,7 +458,7 @@
RelativePath="..\Objects\codeobject.c">
</File>
<File
- RelativePath="..\Modules\collectionsmodule.c">
+ RelativePath="..\Modules\_collectionsmodule.c">
</File>
<File
RelativePath="..\Python\compile.c">
diff --git a/PCbuild8/pythoncore.vcproj b/PCbuild8/pythoncore.vcproj
index f335879..16a250e 100644
--- a/PCbuild8/pythoncore.vcproj
+++ b/PCbuild8/pythoncore.vcproj
@@ -1381,7 +1381,7 @@
>
</File>
<File
- RelativePath="..\Modules\collectionsmodule.c"
+ RelativePath="..\Modules\_collectionsmodule.c"
>
</File>
<File
diff --git a/setup.py b/setup.py
index 32ea77a..98d0e97 100644
--- a/setup.py
+++ b/setup.py
@@ -370,7 +370,7 @@ class PyBuildExt(build_ext):
# fast iterator tools implemented in C
exts.append( Extension("itertools", ["itertoolsmodule.c"]) )
# high-performance collections
- exts.append( Extension("collections", ["collectionsmodule.c"]) )
+ exts.append( Extension("_collections", ["_collectionsmodule.c"]) )
# bisect
exts.append( Extension("_bisect", ["_bisectmodule.c"]) )
# heapq