Add support for inference of method arguments
All threads resolved!
All threads resolved!
This MR closes #409 (closed).
- A new test has been added to ensure that method arguments are inferred correctly, complementing the same functionality for functions
- A new function is provided,
utils._infer_args_from_function_except_n_args
to allow an arbitrary number of arguments to be ignored. -
utils.infer_parameters_from_function
has been updated to infer if a passed argument is a function or a method (or will raise aValueError
if it is neither.
The behaviour of utils.infer_parameters_from_function
may not be considered optimal, as it will fail in the case that an object with a __call__()
method is passed as an argument. If you're keen for this form to be supported I can add an additional case for it.
Edited by Daniel Williams
Merge request reports
Activity
added 1 commit
- df0460e4 - Removed trailing whitespace... from docstrings...
added 1 commit
- 0995d176 - It helps a lot when you write your tests properly...
added 1 commit
- 5707f827 - Changed the _infer_..._first_arg method to use generic n_arg function.
changed milestone to %0.5.9
added Feature-request label
- Automatically resolved by Daniel Williams
So hopefully ace1c8d5 should resolve any remaining issue with excessive inline comments.
mentioned in commit b04498c6
Nice work, thanks @daniel-williams
Please register or sign in to reply