these builtins have to be initialized
diff --git a/Include/Python.h b/Include/Python.h
index 969ef0f..5c6e1f2 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -113,6 +113,7 @@
#include "import.h"
#include "abstract.h"
+#include "bltinmodule.h"
#include "compile.h"
#include "eval.h"
diff --git a/Include/bltinmodule.h b/Include/bltinmodule.h
new file mode 100644
index 0000000..868c9e6
--- /dev/null
+++ b/Include/bltinmodule.h
@@ -0,0 +1,14 @@
+#ifndef Py_BLTINMODULE_H
+#define Py_BLTINMODULE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+PyAPI_DATA(PyTypeObject) PyFilter_Type;
+PyAPI_DATA(PyTypeObject) PyMap_Type;
+PyAPI_DATA(PyTypeObject) PyZip_Type;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !Py_BLTINMODULE_H */
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 0a4b35e..f46b7ad 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -612,6 +612,7 @@
Include/abstract.h \
Include/asdl.h \
Include/ast.h \
+ Include/bltinmodule.h \
Include/bitset.h \
Include/boolobject.h \
Include/bytes_methods.h \
diff --git a/Objects/object.c b/Objects/object.c
index 9544b9a..58b70f0 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1595,6 +1595,15 @@
if (PyType_Ready(&PyMemberDescr_Type) < 0)
Py_FatalError("Can't initialize member descriptor type");
+
+ if (PyType_Ready(&PyFilter_Type) < 0)
+ Py_FatalError("Can't initialize filter type");
+
+ if (PyType_Ready(&PyMap_Type) < 0)
+ Py_FatalError("Can't initialize map type");
+
+ if (PyType_Ready(&PyZip_Type) < 0)
+ Py_FatalError("Can't initialize zip type");
}
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 7a27fba..c33a37e 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -317,8 +317,6 @@
PyObject *it;
} filterobject;
-PyTypeObject PyFilter_Type;
-
static PyObject *
filter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
@@ -913,8 +911,6 @@
PyObject *func;
} mapobject;
-PyTypeObject PyMap_Type;
-
static PyObject *
map_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
@@ -2031,8 +2027,6 @@
PyObject *result;
} zipobject;
-PyTypeObject PyZip_Type;
-
static PyObject *
zip_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{