All Downloads are FREE. Search and download functionalities are using the official Maven repository.

python.python-experimental.model_templates.methods_tostr_eq_simple.mustache Maven / Gradle / Ivy

    def to_str(self):
        """Returns the string representation of the model"""
        return str(self.value)

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, self.__class__):
            return False

        this_val = self._data_store['value']
        that_val = other._data_store['value']
        types = set()
        types.add(this_val.__class__)
        types.add(that_val.__class__)
        vals_equal = this_val == that_val
        if not six.PY3 and len(types) == 2 and unicode in types:  # noqa: F821
            vals_equal = (
                this_val.encode('utf-8') == that_val.encode('utf-8')
            )
        if not vals_equal:
            return False
        return True




© 2015 - 2024 Weber Informatics LLC | Privacy Policy