Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use simple lambdas #31

Merged
merged 2 commits into from
Mar 14, 2017
Merged

Use simple lambdas #31

merged 2 commits into from
Mar 14, 2017

Conversation

cfournie
Copy link
Contributor

Lambdas can be very useful but they are "[h]arder to read and debug than local functions. The lack of names means stack traces are more difficult to understand. Expressiveness is limited because the function may only contain an expression."

To limit need to debug lambdas let's encourage them to be simple and to have a maximum number os AST nodes. The default of 15 was chosen arbitrarily.

@@ -63,6 +63,10 @@ class GoogleStyleGuideChecker(checkers.BaseChecker):
'finally-too-long',
"The larger the 'finally' body size, the more likely that an exception will be raised during "
"resource cleanup activities."),
'C2611': ('Lambda has %(found)i nodes',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs updating

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants