solver.py
def solve(self, callback=None):
        """
        Return a solved copy of this sudoku.

        Parameters
        ----------
        callback : callable
            Function to be called every time the function recurses

        Returns
        -------
        Sudoku
            Solved sudoku
        """
        new_sudoku = copy.deepcopy(self)
        ret_val = new_sudoku._easy_step()

        if callback:
            callback(new_sudoku.progress)

        if ret_val is None:
            logger.info('Sudoku solved!')
            return new_sudoku

        cell_idx, possibilities = ret_val
        possibilities = list(possibilities)

        for possibility in possibilities:
            new_sudoku2 = copy.deepcopy(new_sudoku)
            new_sudoku2.cells[cell_idx].value = possibility
            try:
                return new_sudoku2.solve(callback)
            except ClashException:
                continue

        raise ClashException('This sudoku is not solvable from the given state')

        Return a solved copy of this sudoku.

        Parameters
        ----------
        callback : callable
            Function to be called every time the function recurses

        Returns
        -------
        Sudoku
            Solved sudoku
        
Return a solved copy of this sudoku.
Parameters

callback : callable
Function to be called every time the function recurses

Returns

Sudoku
Solved sudoku
Return a solved copy of this sudoku . Parameters callback : callable Function to be called every time the function recurses Returns Sudoku Solved sudoku
def solve(self, callback=None):
        new_sudoku = copy.deepcopy(self)
        ret_val = new_sudoku._easy_step()
        if callback:
            callback(new_sudoku.progress)
        if ret_val is None:
            logger.info('Sudoku solved!')
            return new_sudoku
        cell_idx, possibilities = ret_val
        possibilities = list(possibilities)
        for possibility in possibilities:
            new_sudoku2 = copy.deepcopy(new_sudoku)
            new_sudoku2.cells[cell_idx].value = possibility
            try:
                return new_sudoku2.solve(callback)
            except ClashException:
                continue
        raise ClashException('This sudoku is not solvable from the given state')
def solve ( self , callback = None ) : new_sudoku = copy . deepcopy ( self ) ret_val = new_sudoku . _easy_step ( ) if callback : callback ( new_sudoku . progress ) if ret_val is None : logger . info ( 'Sudoku solved!' ) return new_sudoku cell_idx , possibilities = ret_val possibilities = list ( possibilities ) for possibility in possibilities : new_sudoku2 = copy . deepcopy ( new_sudoku ) new_sudoku2 . cells [ cell_idx ] . value = possibility try : return new_sudoku2 . solve ( callback ) except ClashException : continue raise ClashException ( 'This sudoku is not solvable from the given state' )
Return a solved copy of this sudoku.
Return a solved copy of this sudoku .
"""
        Return a solved copy of this sudoku.

        Parameters
        ----------
        callback : callable
            Function to be called every time the function recurses

        Returns
        -------
        Sudoku
            Solved sudoku
        """
self
callback