Python: Allow a range to be a python tuple/list.

--HG--
extra : convert_revision : 81cf805055e2f4d62e56a02ac82a0b230251f40b
This commit is contained in:
Ali Saidi 2007-11-08 10:46:41 -05:00
parent 11b931df6a
commit f4222610ea

View file

@ -457,6 +457,9 @@ class Range(ParamValue):
elif isinstance(args[0], Range):
self.first = self.type(args[0].first)
self.second = self.type(args[0].second)
elif isinstance(args[0], (list, tuple)):
self.first = self.type(args[0][0])
self.second = self.type(args[0][1])
else:
self.first = self.type(0)
self.second = self.type(args[0]) - 1