projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
218a35f
)
fix doctest
author
Stefan Behnel
<scoder@users.berlios.de>
Tue, 30 Dec 2008 11:34:58 +0000
(12:34 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Tue, 30 Dec 2008 11:34:58 +0000
(12:34 +0100)
tests/run/locals.pyx
patch
|
blob
|
history
diff --git
a/tests/run/locals.pyx
b/tests/run/locals.pyx
index c25480acd100a7ee5a0a4a50ccd646b24ebfa490..e0ae907bb5572837ddf35396aeac167969fffd57 100644
(file)
--- a/
tests/run/locals.pyx
+++ b/
tests/run/locals.pyx
@@
-1,9
+1,20
@@
-__doc__ = """
-
sage: get_locals(1,2,3
)
-{'args': (2, 3), 'kwds': {}, 'x': 1, 'y': 'hi', 'z': 5}
+__doc__ =
u
"""
+
>>> sorted( get_locals(1,2,3, k=5) .items()
)
+[('args', (2, 3)), ('kwds', {'k': 5}), ('x', 1), ('y', 'hi'), ('z', 5)]
"""
+import sys
+IS_PY3 = sys.version_info[0] >= 3
+
def get_locals(x, *args, **kwds):
- y = "hi"
cdef int z = 5
+ if IS_PY3:
+ y = u"hi"
+ else:
+ y = "hi"
return locals()
+
+def sorted(it):
+ l = list(it)
+ l.sort()
+ return l