pycodestyle
pycodestyle copied to clipboard
Fixing false negatives with E731 lambda assignments
fixes #1061 Changed out the current implementation of lambda assignment detection for a regex based one. As stated in #1061, there are several lambda assignment cases that are being missed. Additionally, the current detection implementation is not in the most logical place. Before, detection of lambdas was tied to searching for ':' characters. Now lambda assignment statements are all just detected by:
(?<!\.)\w+\s*(\,\s*\w+\s*)*\=(.*\,)*[\s|\(]*lambda
This implementation has more coverage and is more simple than the previous one.