def sum(self, callback=None):
        """
        Get the sum of the given values.

        :param callback: The callback
        :type callback: callable or string or None

        :rtype: mixed
        """
        if callback is None:
            return sum(self.items)

        callback = self._value_retriever(callback)

        return self.reduce(lambda result, item: (result or 0) + callback(item))
def sum ( self , callback = None ) : if callback is None : return sum ( self . items ) callback = self . _value_retriever ( callback ) return self . reduce ( lambda result , item : ( result or 0 ) + callback ( item ) )
Get the sum of the given values.

        :param callback: The callback
        :type callback: callable or string or None

        :rtype: mixed