futurize stage2 core
This commit is contained in:
+1
-2
@@ -72,6 +72,7 @@ printed left-to-right. These functions are written to support :doc:`../pretty`.
|
||||
'''
|
||||
|
||||
|
||||
from builtins import map
|
||||
def list_to_stack(el, stack=()):
|
||||
'''Convert a Python list (or other sequence) to a Joy stack::
|
||||
|
||||
@@ -129,7 +130,6 @@ def expression_to_string(expression):
|
||||
|
||||
|
||||
def _to_string(stack, f):
|
||||
if isinstance(stack, long): return str(stack).rstrip('L')
|
||||
if not isinstance(stack, tuple): return repr(stack)
|
||||
if not stack: return '' # shortcut
|
||||
return ' '.join(map(_s, f(stack)))
|
||||
@@ -137,7 +137,6 @@ def _to_string(stack, f):
|
||||
|
||||
_s = lambda s: (
|
||||
'[%s]' % expression_to_string(s) if isinstance(s, tuple)
|
||||
else str(s).rstrip('L') if isinstance(s, long)
|
||||
else repr(s)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user