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" #include "Python.h"
...@@ -913,6 +914,9 @@ initoperator(void) ...@@ -913,6 +914,9 @@ initoperator(void)
if (m == NULL) if (m == NULL)
return; return;
/* Pyston TODO: un-comment these when we have the functionality to
* support them.
if (PyType_Ready(&itemgetter_type) < 0) if (PyType_Ready(&itemgetter_type) < 0)
return; return;
Py_INCREF(&itemgetter_type); Py_INCREF(&itemgetter_type);
...@@ -927,4 +931,5 @@ initoperator(void) ...@@ -927,4 +931,5 @@ initoperator(void)
return; return;
Py_INCREF(&methodcaller_type); Py_INCREF(&methodcaller_type);
PyModule_AddObject(m, "methodcaller", (PyObject *)&methodcaller_type); PyModule_AddObject(m, "methodcaller", (PyObject *)&methodcaller_type);
*/
} }
...@@ -831,8 +831,7 @@ void setupRuntime() { ...@@ -831,8 +831,7 @@ void setupRuntime() {
init_random(); init_random();
init_sre(); init_sre();
initmath(); initmath();
// TODO enable this initoperator();
// initoperator();
initbinascii(); initbinascii();
setupSysEnd(); 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