pydata/pandas — pull request #8883 by behzadnouri (2014-11-23 22:20:35+00:00)
Title: REF: refactor **kwargs usage

related issue: https://github.com/pydata/pandas/issues/8597.

among changes:

[tests/test_generic.py](https://github.com/pydata/pandas/blob/0a2ea0ac39a74771d54b91522728f6092b0ef897/pandas/tests/test_generic.py#L603) `downcast` is misspelled `donwcast`, but no error is raised, because of how `**kwargs` is used.

[core/categorical.py:sort](https://github.com/pydata/pandas/blob/0a2ea0ac39a74771d54b91522728f6092b0ef897/pandas/core/categorical.py#L945) `na_position` is not passed to `self.order`.

[core/categorical.py:fillna](https://github.com/pydata/pandas/blob/0a2ea0ac39a74771d54b91522728f6092b0ef897/pandas/core/categorical.py#L981) `Categorical.fillna` does not support `inplace` as opposed to say `Series.fillna` or `DataFrame.fillna`, but `**kwargs` being there causes below code to just silently ignore passed argument:

>>> ca = pd.Categorical([0, 0, 2, 2, 3, np.nan])
>>> ca.fillna(0, inplace=True)
[0, 0, 2, 2, 3, 0]
Categories (3, int64): [0 < 2 < 3]
>>> ca
[0, 0, 2, 2, 3, NaN]
Categories (3, int64): [0 < 2 < 3]

[This test](https://github.com/pydata/pandas/blob/0a2ea0ac39a74771d54b91522728f6092b0ef897/pandas/tests/test_groupby.py#L4418) is basically testing that you can specify _any_ keyword argument and it is just silently ignored. I cannot think of any case that this would be a good idea, or has any use case.

multiple instances where `*args` or `*kwargs` are not passed to inner function, as can be seen in the PR diff.