Why not `mode == 'constant'`? mode can't contain multiple possibilities.