python.python-experimental.model_templates.methods_shared.mustache Maven / Gradle / Ivy
def __setitem__(self, name, value):
"""this allows us to set values with instance[field_name] = val"""
self.__setattr__(name, value)
def __getitem__(self, name):
"""this allows us to get a value with val = instance[field_name]"""
return self.__getattr__(name)
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
© 2015 - 2024 Weber Informatics LLC | Privacy Policy