The design follows that of librosa stft 1, which also uses n_fft to detect number of frames.
There’s also a discussion about win_length and n_fft you might be interested: Semantics of n_fft, window length, and frame length · Issue #695 · librosa/librosa · GitHub 2