Python: Allow a range to be a python tuple/list.
authorAli Saidi <saidi@eecs.umich.edu>
Thu, 8 Nov 2007 15:46:41 +0000 (10:46 -0500)
committerAli Saidi <saidi@eecs.umich.edu>
Thu, 8 Nov 2007 15:46:41 +0000 (10:46 -0500)
--HG--
extra : convert_revision : 81cf805055e2f4d62e56a02ac82a0b230251f40b

src/python/m5/params.py

index 27bb24bd7b23d84a46a469e6da676b8a1660c63c..241d4ceaf01e4f79ae6a684a3cab7cf41b68d903 100644 (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