Prepare collections module for pure python code entries.

This commit is contained in:
Raymond Hettinger 2007-02-28 18:37:52 +00:00
parent 3035d2397f
commit eb9798892d
6 changed files with 10 additions and 7 deletions

3
Lib/collections.py Normal file
View File

@ -0,0 +1,3 @@
__all__ = ['deque', 'defaultdict']
from _collections import deque, defaultdict

View File

@ -1337,11 +1337,11 @@ PyDoc_STRVAR(module_doc,
"); ");
PyMODINIT_FUNC PyMODINIT_FUNC
initcollections(void) init_collections(void)
{ {
PyObject *m; PyObject *m;
m = Py_InitModule3("collections", NULL, module_doc); m = Py_InitModule3("_collections", NULL, module_doc);
if (m == NULL) if (m == NULL)
return; return;

View File

@ -43,7 +43,7 @@ extern void initxxsubtype(void);
extern void initzipimport(void); extern void initzipimport(void);
extern void init_random(void); extern void init_random(void);
extern void inititertools(void); extern void inititertools(void);
extern void initcollections(void); extern void init_collections(void);
extern void init_heapq(void); extern void init_heapq(void);
extern void init_bisect(void); extern void init_bisect(void);
extern void init_symtable(void); extern void init_symtable(void);
@ -124,7 +124,7 @@ struct _inittab _PyImport_Inittab[] = {
{"_heapq", init_heapq}, {"_heapq", init_heapq},
{"_lsprof", init_lsprof}, {"_lsprof", init_lsprof},
{"itertools", inititertools}, {"itertools", inititertools},
{"collections", initcollections}, {"_collections", init_collections},
{"_symtable", init_symtable}, {"_symtable", init_symtable},
{"mmap", initmmap}, {"mmap", initmmap},
{"_csv", init_csv}, {"_csv", init_csv},

View File

@ -458,7 +458,7 @@
RelativePath="..\Objects\codeobject.c"> RelativePath="..\Objects\codeobject.c">
</File> </File>
<File <File
RelativePath="..\Modules\collectionsmodule.c"> RelativePath="..\Modules\_collectionsmodule.c">
</File> </File>
<File <File
RelativePath="..\Python\compile.c"> RelativePath="..\Python\compile.c">

View File

@ -1381,7 +1381,7 @@
> >
</File> </File>
<File <File
RelativePath="..\Modules\collectionsmodule.c" RelativePath="..\Modules\_collectionsmodule.c"
> >
</File> </File>
<File <File

View File

@ -370,7 +370,7 @@ class PyBuildExt(build_ext):
# fast iterator tools implemented in C # fast iterator tools implemented in C
exts.append( Extension("itertools", ["itertoolsmodule.c"]) ) exts.append( Extension("itertools", ["itertoolsmodule.c"]) )
# high-performance collections # high-performance collections
exts.append( Extension("collections", ["collectionsmodule.c"]) ) exts.append( Extension("_collections", ["_collectionsmodule.c"]) )
# bisect # bisect
exts.append( Extension("_bisect", ["_bisectmodule.c"]) ) exts.append( Extension("_bisect", ["_bisectmodule.c"]) )
# heapq # heapq