def compile_time_value(self, denv):
base = self.base.compile_time_value(denv)
- start = self.start.compile_time_value(denv)
- stop = self.stop.compile_time_value(denv)
+ if self.start is None:
+ start = 0
+ else:
+ start = self.start.compile_time_value(denv)
+ if self.stop is None:
+ stop = None
+ else:
+ stop = self.stop.compile_time_value(denv)
try:
return base[start:stop]
except Exception, e:
def compile_time_value(self, denv):
start = self.start.compile_time_value(denv)
- stop = self.stop.compile_time_value(denv)
- step = step.step.compile_time_value(denv)
+ if self.stop is None:
+ stop = None
+ else:
+ stop = self.stop.compile_time_value(denv)
+ if self.step is None:
+ step = None
+ else:
+ step = self.step.compile_time_value(denv)
try:
return slice(start, stop, step)
except Exception, e:
DEF FIVE = TWO + 3
DEF TRUE = TRUE_FALSE[0]
DEF FALSE = TRUE_FALSE[1]
+DEF INT_TUPLE1 = TUPLE[:2]
+DEF INT_TUPLE2 = TUPLE[1:4:2]
def c():
cdef char c
two = TWO
return two
+# this doesn't currently work!
+#def two2():
+# cdef int two
+# two = INT_TUPLE1[-1]
+# return two
+
def five():
cdef int five
five = FIVE