fix weird failure in variant values (#22328)
This commit is contained in:
parent
912606ad9a
commit
18fbd58fe6
@ -282,8 +282,21 @@ def _value_setter(self, value):
|
|||||||
# to a set
|
# to a set
|
||||||
self._value = tuple(sorted(set(value)))
|
self._value = tuple(sorted(set(value)))
|
||||||
|
|
||||||
|
def _cmp_value(self):
|
||||||
|
"""Returns a tuple of strings containing the values stored in
|
||||||
|
the variant.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
tuple of str: values stored in the variant
|
||||||
|
"""
|
||||||
|
value = self._value
|
||||||
|
if not isinstance(value, tuple):
|
||||||
|
value = (value,)
|
||||||
|
stringified = tuple(str(x) for x in value)
|
||||||
|
return stringified
|
||||||
|
|
||||||
def _cmp_key(self):
|
def _cmp_key(self):
|
||||||
return self.name, self.value
|
return self.name, self._cmp_value()
|
||||||
|
|
||||||
def copy(self):
|
def copy(self):
|
||||||
"""Returns an instance of a variant equivalent to self
|
"""Returns an instance of a variant equivalent to self
|
||||||
|
Loading…
Reference in New Issue
Block a user