Commit 17258e73 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #146 from tjhance/operator_import

Conflicts:
	src/runtime/types.cpp
parents fa64047a 9b5036b9
// This file is originally from CPython 2.7, with modifications for Pyston
#include "Python.h"
......@@ -913,6 +914,9 @@ initoperator(void)
if (m == NULL)
return;
/* Pyston TODO: un-comment these when we have the functionality to
* support them.
if (PyType_Ready(&itemgetter_type) < 0)
return;
Py_INCREF(&itemgetter_type);
......@@ -927,4 +931,5 @@ initoperator(void)
return;
Py_INCREF(&methodcaller_type);
PyModule_AddObject(m, "methodcaller", (PyObject *)&methodcaller_type);
*/
}
......@@ -831,8 +831,7 @@ void setupRuntime() {
init_random();
init_sre();
initmath();
// TODO enable this
// initoperator();
initoperator();
initbinascii();
setupSysEnd();
......
# expected: fail
import operator
print operator.methodcaller
print operator.itemgetter
print operator.attrgetter
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment