features: characteristic: simplify freeze

closes #65
This commit is contained in:
William Ballenthin
2020-07-14 11:32:17 -06:00
parent 03c529a98c
commit e28de9292b

View File

@@ -71,19 +71,6 @@ class Characteristic(Feature):
def __init__(self, value, description=None):
super(Characteristic, self).__init__(value, description)
def freeze_serialize(self):
# in an older version of capa, characteristics could theoretically match non-existence (value=False).
# but we found this was never used (and better expressed with `not: characteristic: ...`).
# this was represented using an additional parameter for Characteristic.
# its been removed, but we keep it around in the freeze format to maintain backwards compatibility.
# this value is ignored, however.
return (self.__class__.__name__, [self.value, True])
@classmethod
def freeze_deserialize(cls, args):
# see above. we ignore the second element in the 2-tuple here.
return cls(args[0])
class String(Feature):
def __init__(self, value, description=None):