Hack to special case *args and *kwargs in args/parameter lists#27
Hack to special case *args and *kwargs in args/parameter lists#27
Conversation
|
Looks like GitHub didn't run... curious. We ought to run this on a large test set before including this on a release. |
|
Using pyquil (previously tested with this package), the changes on this pull request make no difference: Interesting case in https://github.com/rigetti/pyquil/blob/v2.19.0/pyquil/simulation/tests/test_numpy.py#L273 which has one naughty def kron(*matrices: np.ndarray) -> np.ndarray:
"""Computes the kronecker product of a sequence of matrices.
A *args version of lambda args: functools.reduce(np.kron, args).
Args:
*matrices: The matrices and controls to combine with the kronecker
product.
Returns:
The resulting matrix.
"""
....Could potentially inspect the function definition to decide which starred variable names to check for and thus ignore |
|
Similar in astropy, plenty of examples where the variable names are not |
|
This needs a little refactoring now... rebasing. |
Note Astropy uses colon and type/optional annotation
|
CodeClimate is rightly critical of the style of this fix. |
This might solve #18, but at the cost of hiding some true misuse of italics or bold within the same docstring. Might be worthwhile all the same?
(This is a bit of a surface level hack - A more precise fix would need deeper integration into the docutils internals)