shogi/Piece.py
def from_symbol(cls, symbol):
        '''
        Creates a piece instance from a piece symbol.
        Raises `ValueError` if the symbol is invalid.
        '''
        if symbol.lower() == symbol:
            return cls(PIECE_SYMBOLS.index(symbol), WHITE)
        else:
            return cls(PIECE_SYMBOLS.index(symbol.lower()), BLACK)
def from_symbol(cls, symbol):
        '''
        Creates a piece instance from a piece symbol.
        Raises `ValueError` if the symbol is invalid.
        '''
        if symbol.lower() == symbol:
            return cls(PIECE_SYMBOLS.index(symbol), WHITE)
        else:
            return cls(PIECE_SYMBOLS.index(symbol.lower()), BLACK)
def from_symbol ( cls , symbol ) : if symbol . lower ( ) == symbol : return cls ( PIECE_SYMBOLS . index ( symbol ) , WHITE ) else : return cls ( PIECE_SYMBOLS . index ( symbol . lower ( ) ) , BLACK )
Creates a piece instance from a piece symbol.
        Raises `ValueError` if the symbol is invalid.
Creates a piece instance from a piece symbol . Raises ValueError if the symbol is invalid .