summaryrefslogtreecommitdiff
path: root/scss/types.py
diff options
context:
space:
mode:
authorGerman M. Bravo <german.mb@deipi.com>2013-10-03 11:12:36 -0500
committerGerman M. Bravo <german.mb@deipi.com>2013-10-03 11:12:36 -0500
commit0586aae792aa67c97161d996ba23892439f43e6a (patch)
treef14636245c8388a8e1b086c3e4bc6b098dd89e94 /scss/types.py
parent7a1796b922c600d6970ae978333ce471ded707f9 (diff)
downloadpyscss-0586aae792aa67c97161d996ba23892439f43e6a.tar.gz
Hashable lists and maps
Diffstat (limited to 'scss/types.py')
-rw-r--r--scss/types.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scss/types.py b/scss/types.py
index 00cf73e..c2c7c25 100644
--- a/scss/types.py
+++ b/scss/types.py
@@ -575,7 +575,7 @@ class List(Value):
)
def __hash__(self):
- return hash((self.value, self.use_comma))
+ return hash((tuple(self.value), self.use_comma))
def delimiter(self, compress=False):
if self.use_comma:
@@ -882,6 +882,7 @@ class Color(Value):
# TODO be unicode-clean and delete this nonsense
DEFAULT_STRING_ENCODING = "utf8"
+
class String(Value):
"""Represents both CSS quoted string values and CSS identifiers (such as
`left`).
@@ -978,7 +979,7 @@ class Map(Value):
sass_type_name = u'map'
def __init__(self, pairs):
- self.pairs = pairs
+ self.pairs = tuple(pairs)
self.index = {}
for key, value in pairs:
self.index[key] = value