Knight on the rim is dim

def dims_knight(self, move):
    '''Knight on the rim is dim'''
    if self.board.piece_type_at(move.from_square) == chess.KNIGHT:
      rim = SquareSet(
          chess.BB_RANK_1 | \
          chess.BB_RANK_8 | \
          chess.BB_FILE_A | \
          chess.BB_FILE_H)
      return move.to_square in rim