def begin(self, write=False, stats=None, timeout=None):
        """

        :param write:
        :param stats:
        :param timeout:
        :return:
        """
        if write and self._readonly:
            raise Exception('database is read-only')

        txn = DbTransaction(db=self, write=write, stats=stats, timeout=timeout)

        return txn
def begin ( self , write = False , stats = None , timeout = None ) : if write and self . _readonly : raise Exception ( 'database is read-only' ) txn = DbTransaction ( db = self , write = write , stats = stats , timeout = timeout ) return txn
:param write:
        :param stats:
        :param timeout:
        :return: