There is precedent elsewhere in the library of using `None` as the default
value.

You frequently want to wrap matplotlib functions with your own (that do
your data extraction and clean up, set up multi-panel figures, or what
ever).  By using `None` as the default you can have optional kwargs to your
own functions (which also deault to `None`) and get sensible behavior
without having to transcribe the defaults into your code.


On Tue, Oct 22, 2013 at 11:28 AM, Pierre Haessig
<notifications@github.com>wrote:

> In lib/matplotlib/mlab.py:
>
> > +        #implement the core of psd(), csd(), and spectrogram() without doing
> > +        #extra calculations.  We return the unaveraged Pxy, freqs, and t.
> > +        same_data = y is x
> > +
> > +    if Fs is None:
> > +        Fs = 2
> > +    if noverlap is None:
> > +        noverlap = 0
> > +    if detrend_func is None:
> > +        detrend_func = detrend_none
> > +    if window is None:
> > +        window = window_hanning
> > +
> > +    # if NFFT is set to None use the whole signal
> > +    if NFFT is None:
> > +        NFFT = 256
>
> I don't get the if NFFT is None: NFFT = 256. Why not keep the default
> value 256 in the function signature then ?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/matplotlib/matplotlib/pull/2522/files#r7131669>
> .
>



-- 
Thomas Caswell
tcaswell@gmail.com