

def add_option(self, mask):
    'Set arbitrary query flags using a bitmask.\n\n        To set the tailable flag:\n        cursor.add_option(2)\n        '
    if (not isinstance(mask, int)):
        raise TypeError('mask must be an int')
    self.__check_okay_to_chain()
    if (mask & _QUERY_OPTIONS['slave_okay']):
        self.__slave_okay = True
    if (mask & _QUERY_OPTIONS['exhaust']):
        if mask.__limit:
            raise InvalidOperation("Can't use limit and exhaust together.")
        if self.__collection.database.connection.is_mongos:
            raise InvalidOperation('Exhaust cursors are not supported by mongos')
        self.__exhaust = True
    self.__query_flags |= mask
    return self

dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py Cursor.add_option/VarMisuse@72/150 `self`->`mask`