diff --git a/CHANGELOG.md b/CHANGELOG.md
index d8127cf..ca880fb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,8 @@
 ### Fixed
 - Fix SPLIT_ARGUMENTS_WHEN_COMMA_TERMINATED for one-item named argument lists
   by taking precedence over SPLIT_BEFORE_NAMED_ASSIGNS.
+- Fix SPLIT_ALL_COMMA_SEPARATED_VALUES and SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES
+  being too agressive for lambdas and unpacking.
 
 ## [0.40.2] 2023-09-22
 ### Changes
diff --git a/yapf/pytree/subtype_assigner.py b/yapf/pytree/subtype_assigner.py
index 05d88b0..e3b3277 100644
--- a/yapf/pytree/subtype_assigner.py
+++ b/yapf/pytree/subtype_assigner.py
@@ -222,6 +222,11 @@ class _SubtypeAssigner(pytree_visitor.PyTreeVisitor):
       if isinstance(child, pytree.Leaf) and child.value == '**':
         _AppendTokenSubtype(child, subtypes.BINARY_OPERATOR)
 
+  def Visit_lambdef(self, node):  # pylint: disable=invalid-name
+    # trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
+    _AppendSubtypeRec(node, subtypes.LAMBDEF)
+    self.DefaultNodeVisit(node)
+
   def Visit_trailer(self, node):  # pylint: disable=invalid-name
     for child in node.children:
       self.Visit(child)
diff --git a/yapf/yapflib/format_decision_state.py b/yapf/yapflib/format_decision_state.py
index ce74313..06f3455 100644
--- a/yapf/yapflib/format_decision_state.py
+++ b/yapf/yapflib/format_decision_state.py
@@ -180,6 +180,10 @@ class FormatDecisionState(object):
       return False
 
     if style.Get('SPLIT_ALL_COMMA_SEPARATED_VALUES') and previous.value == ',':
+      if (subtypes.COMP_FOR in current.subtypes or
+          subtypes.LAMBDEF in current.subtypes):
+        return False
+
       return True
 
     if (style.Get('FORCE_MULTILINE_DICT') and
@@ -188,6 +192,11 @@ class FormatDecisionState(object):
 
     if (style.Get('SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES') and
         previous.value == ','):
+
+      if (subtypes.COMP_FOR in current.subtypes or
+          subtypes.LAMBDEF in current.subtypes):
+        return False
+
       # Avoid breaking in a container that fits in the current line if possible
       opening = _GetOpeningBracket(current)
 
diff --git a/yapf/yapflib/subtypes.py b/yapf/yapflib/subtypes.py
index b4b7efe..3c234fb 100644
--- a/yapf/yapflib/subtypes.py
+++ b/yapf/yapflib/subtypes.py
@@ -38,3 +38,4 @@ TYPED_NAME_ARG_LIST = 21
 SIMPLE_EXPRESSION = 22
 PARAMETER_START = 23
 PARAMETER_STOP = 24
+LAMBDEF = 25

diff --git a/yapftests/reformatter_basic_test.py b/yapftests/reformatter_basic_test.py
index 24f34a6..d58343e 100644
--- a/yapftests/reformatter_basic_test.py
+++ b/yapftests/reformatter_basic_test.py
@@ -91,6 +91,30 @@ class BasicReformatterTest(yapf_test_helper.YAPFTest):
     """)
     llines = yapf_test_helper.ParseAndUnwrap(unformatted_code)
     self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(llines))
+    unformatted_code = textwrap.dedent("""\
+        values = [ lambda arg1, arg2: arg1 + arg2 ]
+    """)  # noqa
+    expected_formatted_code = textwrap.dedent("""\
+        values = [
+            lambda arg1, arg2: arg1 + arg2
+        ]
+    """)
+    llines = yapf_test_helper.ParseAndUnwrap(unformatted_code)
+    self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(llines))
+    unformatted_code = textwrap.dedent("""\
+        values = [
+            (some_arg1, some_arg2) for some_arg1, some_arg2 in values
+        ]
+    """)  # noqa
+    expected_formatted_code = textwrap.dedent("""\
+        values = [
+            (some_arg1,
+             some_arg2)
+            for some_arg1, some_arg2 in values
+        ]
+    """)
+    llines = yapf_test_helper.ParseAndUnwrap(unformatted_code)
+    self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(llines))
     # There is a test for split_all_top_level_comma_separated_values, with
     # different expected value
     unformatted_code = textwrap.dedent("""\
@@ -161,6 +185,32 @@ class BasicReformatterTest(yapf_test_helper.YAPFTest):
     """)
     llines = yapf_test_helper.ParseAndUnwrap(unformatted_code)
     self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(llines))
+    # Works the same way as split_all_comma_separated_values
+    unformatted_code = textwrap.dedent("""\
+        values = [ lambda arg1, arg2: arg1 + arg2 ]
+    """)  # noqa
+    expected_formatted_code = textwrap.dedent("""\
+        values = [
+            lambda arg1, arg2: arg1 + arg2
+        ]
+    """)
+    llines = yapf_test_helper.ParseAndUnwrap(unformatted_code)
+    self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(llines))
+    # There is a test for split_all_comma_separated_values, with different
+    # expected value
+    unformatted_code = textwrap.dedent("""\
+        values = [
+            (some_arg1, some_arg2) for some_arg1, some_arg2 in values
+        ]
+    """)  # noqa
+    expected_formatted_code = textwrap.dedent("""\
+        values = [
+            (some_arg1, some_arg2)
+            for some_arg1, some_arg2 in values
+        ]
+    """)
+    llines = yapf_test_helper.ParseAndUnwrap(unformatted_code)
+    self.assertCodeEqual(expected_formatted_code, reformatter.Reformat(llines))
     # There is a test for split_all_comma_separated_values, with different
     # expected value
     unformatted_code = textwrap.dedent("""\

`SPLIT_ALL[_TOP_LEVEL]_COMMA_SEPARATED_VALUES` breaks on tuple unpacking
```python
values = [
  ('a', '1'),
  ('b', '2'),
]
values = [
  really_quite_long_function(some_quite_long_arg, value)
  for some_quite_long_arg, value in values
]
```
with `SPLIT_ALL_COMMA_SEPARATED_VALUES` enabled being reformatted to
```python
values = [
    ('a',
     '1'),
    ('b',
     '2'),
]
values = [
    really_quite_long_function(some_quite_long_arg,
                               value) for some_quite_long_arg,
    value in values
]
```
and with `SPLIT_ALL_TOP_LEVEL_COMMA_SEPARATED_VALUES` enabled being reformatted to
```python
values = [
    ('a', '1'),
    ('b', '2'),
]
values = [
    really_quite_long_function(some_quite_long_arg, value)
    for some_quite_long_arg,
    value in values
]
```
while replacing
```python
  for some_quite_long_arg, value in values
```
with
```python
  for (some_quite_long_arg, value) in values
```
yields to a different result.

Is this an intended behavior?
yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingAllArgs yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingTopLevelAllArgs
yapftests/reformatter_basic_test.py::BasicReformatterTest::testArgsAndKwargsFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testBinaryOperators yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLineBeforeClassDocstring yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLineBeforeModuleDocstring yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLinesAtEndOfFile yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLinesBeforeDecorators yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLinesBeforeFunctionsNotInColumnZero yapftests/reformatter_basic_test.py::BasicReformatterTest::testBlankLinesBetweenTopLevelImportsAndVariables yapftests/reformatter_basic_test.py::BasicReformatterTest::testClosingBracketIndent yapftests/reformatter_basic_test.py::BasicReformatterTest::testClosingBracketsInlinedInCall yapftests/reformatter_basic_test.py::BasicReformatterTest::testCoalesceBracketsOnDict yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentBeforeFuncDef yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentBetweenDecorators yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentColumnLimitOverflow yapftests/reformatter_basic_test.py::BasicReformatterTest::testComments yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentsInDataLiteral yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentsWithContinuationMarkers yapftests/reformatter_basic_test.py::BasicReformatterTest::testCommentsWithTrailingSpaces yapftests/reformatter_basic_test.py::BasicReformatterTest::testComprehensionForAndIf yapftests/reformatter_basic_test.py::BasicReformatterTest::testContiguousList yapftests/reformatter_basic_test.py::BasicReformatterTest::testContinuationIndent yapftests/reformatter_basic_test.py::BasicReformatterTest::testContinuationMarkerAfterStringWithContinuation yapftests/reformatter_basic_test.py::BasicReformatterTest::testContinuationMarkers yapftests/reformatter_basic_test.py::BasicReformatterTest::testContinuationSpaceRetention yapftests/reformatter_basic_test.py::BasicReformatterTest::testDedentClosingBracketsWithTypeAnnotationExceedingLineLength yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictSetGenerator yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictionaryElementsOnOneLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictionaryMakerFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictionaryOnOwnLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testDictionaryValuesOnOwnLines yapftests/reformatter_basic_test.py::BasicReformatterTest::testDisableEndingCommaHeuristic yapftests/reformatter_basic_test.py::BasicReformatterTest::testDocstringAndMultilineComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testDocstrings yapftests/reformatter_basic_test.py::BasicReformatterTest::testDontAddBlankLineAfterMultilineString yapftests/reformatter_basic_test.py::BasicReformatterTest::testDontSplitKeywordValueArguments yapftests/reformatter_basic_test.py::BasicReformatterTest::testEllipses yapftests/reformatter_basic_test.py::BasicReformatterTest::testEmptyContainers yapftests/reformatter_basic_test.py::BasicReformatterTest::testEndingComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testEndingWhitespaceAfterSimpleStatement yapftests/reformatter_basic_test.py::BasicReformatterTest::testExcessCharacters yapftests/reformatter_basic_test.py::BasicReformatterTest::testExcessLineCountWithDefaultKeywords yapftests/reformatter_basic_test.py::BasicReformatterTest::testExpressionPenalties yapftests/reformatter_basic_test.py::BasicReformatterTest::testForceMultilineDict_False yapftests/reformatter_basic_test.py::BasicReformatterTest::testForceMultilineDict_True yapftests/reformatter_basic_test.py::BasicReformatterTest::testFormattingListComprehensions yapftests/reformatter_basic_test.py::BasicReformatterTest::testFunctionCallArguments yapftests/reformatter_basic_test.py::BasicReformatterTest::testFunctionCallContinuationLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testFunctionCallInDict yapftests/reformatter_basic_test.py::BasicReformatterTest::testFunctionCallInNestedDict yapftests/reformatter_basic_test.py::BasicReformatterTest::testI18n yapftests/reformatter_basic_test.py::BasicReformatterTest::testI18nCommentsInDataLiteral yapftests/reformatter_basic_test.py::BasicReformatterTest::testI18nNonFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testIfConditionalParens yapftests/reformatter_basic_test.py::BasicReformatterTest::testIfExpressionWithFunctionCall yapftests/reformatter_basic_test.py::BasicReformatterTest::testImportAsList yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentBlankLines yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsInDict yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsInFunctionCall yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsInList yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsInTuple yapftests/reformatter_basic_test.py::BasicReformatterTest::testIndentClosingBracketsWithTypeAnnotationExceedingLineLength yapftests/reformatter_basic_test.py::BasicReformatterTest::testLineDepthOfSingleLineStatement yapftests/reformatter_basic_test.py::BasicReformatterTest::testLineWrapInForExpression yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehension yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehensionPreferNoBreakForTrivialExpression yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehensionPreferOneLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehensionPreferOneLineOverArithmeticSplit yapftests/reformatter_basic_test.py::BasicReformatterTest::testListComprehensionPreferThreeLinesForLineWrap yapftests/reformatter_basic_test.py::BasicReformatterTest::testListWithFunctionCalls yapftests/reformatter_basic_test.py::BasicReformatterTest::testMatchingParenSplittingMatching yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineCommentReformatted yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineDictionaryKeys yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineDocstringAndMultilineComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineLambdas yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineShebang yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultilineString yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultipleContinuationMarkers yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultipleDictionariesInList yapftests/reformatter_basic_test.py::BasicReformatterTest::testMultipleUgliness yapftests/reformatter_basic_test.py::BasicReformatterTest::testNamedAssignNotAtEndOfLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testNestedDictionary yapftests/reformatter_basic_test.py::BasicReformatterTest::testNestedListsInDictionary yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoBreakOutsideOfBracket yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoKeywordArgumentBreakage yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoPenaltySplitting yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoQueueSeletionInMiddleOfLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSpaceBetweenUnaryOpAndOpeningParen yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSpacesAroundKeywordDefaultValues yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSpacesBetweenOpeningBracketAndStartingOperator yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSpacesBetweenSubscriptsAndCalls yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingAroundCompOperators yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingAroundTermOperators yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingBeforeEndingSubscriptBracket yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingOnSingleArgument yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingWhenBinPacking yapftests/reformatter_basic_test.py::BasicReformatterTest::testNoSplittingWithinSubscriptList yapftests/reformatter_basic_test.py::BasicReformatterTest::testNotInParams yapftests/reformatter_basic_test.py::BasicReformatterTest::testNotSplittingAfterSubscript yapftests/reformatter_basic_test.py::BasicReformatterTest::testOpeningAndClosingBrackets yapftests/reformatter_basic_test.py::BasicReformatterTest::testOverColumnLimit yapftests/reformatter_basic_test.py::BasicReformatterTest::testParenthesizedContextManagers yapftests/reformatter_basic_test.py::BasicReformatterTest::testPseudoParens yapftests/reformatter_basic_test.py::BasicReformatterTest::testRelativeImportStatements yapftests/reformatter_basic_test.py::BasicReformatterTest::testRelaxArraySubscriptAffinity yapftests/reformatter_basic_test.py::BasicReformatterTest::testSimpleFunctionsWithTrailingComments yapftests/reformatter_basic_test.py::BasicReformatterTest::testSimpleMultilineCode yapftests/reformatter_basic_test.py::BasicReformatterTest::testSimpleMultilineWithComments yapftests/reformatter_basic_test.py::BasicReformatterTest::testSingleComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testSingleLineFunctions yapftests/reformatter_basic_test.py::BasicReformatterTest::testSingleLineList yapftests/reformatter_basic_test.py::BasicReformatterTest::testSpaceAfterNotOperator yapftests/reformatter_basic_test.py::BasicReformatterTest::testSpaceBetweenStringAndParentheses yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitAfterComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitListWithComment yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitListWithInterspersedComments yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitListWithTerminatingComma yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplitStringsIfSurroundedByParens yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingArgumentsTerminatedByComma yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingArraysSensibly yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingBeforeFirstArgumentOnCompoundStatement yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingBeforeFirstArgumentOnFunctionCall yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingBeforeFirstArgumentOnFunctionDefinition yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingBeforeFirstElementListArgument yapftests/reformatter_basic_test.py::BasicReformatterTest::testSplittingOneArgumentList yapftests/reformatter_basic_test.py::BasicReformatterTest::testStableDictionaryFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testStableInlinedDictionaryFormatting yapftests/reformatter_basic_test.py::BasicReformatterTest::testStructuredPatternMatching yapftests/reformatter_basic_test.py::BasicReformatterTest::testSubscriptExpression yapftests/reformatter_basic_test.py::BasicReformatterTest::testSubscriptExpressionTerminatedByComma yapftests/reformatter_basic_test.py::BasicReformatterTest::testTrailerOnSingleLine yapftests/reformatter_basic_test.py::BasicReformatterTest::testTrailingCommaAndBracket yapftests/reformatter_basic_test.py::BasicReformatterTest::testTupleCohesion yapftests/reformatter_basic_test.py::BasicReformatterTest::testTupleCommaBeforeLastParen yapftests/reformatter_basic_test.py::BasicReformatterTest::testUnaryNotOperator yapftests/reformatter_basic_test.py::BasicReformatterTest::testUnaryOpInDictionaryValue yapftests/reformatter_basic_test.py::BasicReformatterTest::testUnbreakableNot yapftests/reformatter_basic_test.py::BasicReformatterTest::testUnformattedAfterMultilineString yapftests/reformatter_basic_test.py::BasicReformatterTest::testWalrus