Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
9b5036b9
Commit
9b5036b9
authored
Aug 26, 2014
by
Travis Hance
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
got import operator to work
parent
89ecda8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
lib_python/2.7_Modules/operator.c
lib_python/2.7_Modules/operator.c
+5
-0
src/runtime/types.cpp
src/runtime/types.cpp
+1
-2
test/tests/operator.py
test/tests/operator.py
+6
-0
No files found.
lib_python/2.7_Modules/operator.c
View file @
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);
*/
}
src/runtime/types.cpp
View file @
9b5036b9
...
...
@@ -823,8 +823,7 @@ void setupRuntime() {
init_md5
();
init_sre
();
initmath
();
// TODO enable this
// initoperator();
initoperator
();
setupSysEnd
();
...
...
test/tests/operator.py
0 → 100644
View file @
9b5036b9
# expected: fail
import
operator
print
operator
.
methodcaller
print
operator
.
itemgetter
print
operator
.
attrgetter
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment