

def limit(self, limit):
    'Limits the number of results to be returned by this cursor.\n\n        Raises :exc:`TypeError` if `limit` is not an integer. Raises\n        :exc:`~pymongo.errors.InvalidOperation` if this :class:`Cursor`\n        has already been used. The last `limit` applied to this cursor\n        takes precedence. A limit of ``0`` is equivalent to no limit.\n\n        :Parameters:\n          - `limit`: the number of results to return\n\n        .. mongodoc:: limit\n        '
    if (not isinstance(limit, (int, long))):
        raise TypeError('limit must be an integer')
    if self.__exhaust:
        raise InvalidOperation("Can't use limit and exhaust together.")
    self.__check_okay_to_chain()
    self.__empty = False
    self.__limit = limit
    return self

dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py Cursor.limit/original