

def __repr__(self):
    'Return a compact unambiguous string representation of a property.'
    args = []
    cls = self.__class__
    for (i, attr) in enumerate(self._attributes):
        val = getattr(self, attr)
        if (val is not getattr(cls, attr)):
            if isinstance(val, type):
                s = val.__name__
            else:
                s = repr(val)
            if (i >= cls._positional):
                if attr.startswith('_'):
                    attr = attr[1:]
                s = ('%s=%s' % (attr, s))
            args.append(s)
    s = ('%s(%s)' % (self.__class__.__name__, ', '.join(args)))
    return s

dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/model.py Property.__repr__/original