scipy/scipy — pull request #2588 by bburlo (2013-06-20 12:13:53+00:00)
Title: ENH: allow keyword arguments in stats distributions

Should close https://github.com/scipy/scipy/issues/2381.

Works by inspecting the call signatures of distribution-specific `_pdf`/`_pmf` functions and dynamically generating appropriate mappings from generic `*args, **kwds` to the distribution parameters. This avoids complicating further the logic in `_fix_loc_scale_kwarg3` --- in fact the latter is avoided altogether. There is likely no performance penalty, since all the extra work is done during import time, and there is no need for parsing generic arguments at each call.
The cost is `exec`-ing for each distribution a couple of lines of code constructed from a template.
(see also https://github.com/scipy/scipy/pull/400.)

There is also a somewhat related change in a corner case of propagating the `nans` (trac ticket 835, http://projects.scipy.org/scipy/ticket/835).