def __eq__(self, other):
    try:
        return (self['name'] == other['name'])
    except AttributeError:
        return (self['name'] == other)
def __eq__(self, other):
    try:
        return (self['name'] == other['name'])
    except AttributeError:
        return (self['name'] == other)