Closed loganthomas closed 3 years ago
Thank you for the timely and thorough feedback. This is not expected behavior. I just didn't realize that the Lambda
node in python's ast module re-uses the Arguments
node from FunctionDef
and AsyncFunctionDef
. I've given lambdas their own function context, so that their arguments don't leak. (Although, note that this now means that exceptions raised in lambdas won't be detected in the function -- though that seems like an edge case.) I should have resolved the issue in 525577e71f11214d4be7dea187b54423f945cb6a, and will push it to v1.5.7 as soon as my regression tests pass. Thank you!
@terrencepreilly
Thank you so much for your quick fix! Working like a charm on my lambda
functions now. Really appreciate your help! 👍 🎉
Hi @terrencepreilly,
I wanted to thank you for making
darglint
. It's been a huge help for my projects :)I noticed that in a recent release (
1.5.6
I believe), a new functionality was added to handle nested functions. I have seen that this potentially causes issues when usinglambda
functions.Example:
This will cause
darglint
to output the following error:DAR101: Missing parameter(s) in Docstring: - d
Possible Solution
I can solve this by adding an ignore statement (
# noqa: DAR101 d
) to the docstring. However, I wanted to confirm that this was an expected behavior. I would need to add this ignore statement to any function that uses alambda
call.Thank you for any input you can give on this topic!