Simplify 'take'

This commit is contained in:
John Jacobsen 2013-04-21 15:47:45 -05:00
parent f69c6243e8
commit c65df143b9

View File

@ -679,14 +679,11 @@ class HyASTCompiler(object):
expr.pop(0) expr.pop(0)
n = self.compile(expr.pop(0)) n = self.compile(expr.pop(0))
seq = self.compile(expr.pop(0)) seq = self.compile(expr.pop(0))
zero = ast.Num(n=0,
lineno=expr.start_column,
col_offset=expr.start_column)
return ast.Subscript( return ast.Subscript(
lineno=expr.start_line, lineno=expr.start_line,
col_offset=expr.start_column, col_offset=expr.start_column,
value=seq, value=seq,
slice=ast.Slice(lower=zero, slice=ast.Slice(lower=None,
upper=n, upper=n,
step=None), step=None),
ctx=ast.Load()) ctx=ast.Load())