Skip to content

Commit 99a80d2

Browse files
Rename "islambda" tp "singleline".
1 parent 70ddc90 commit 99a80d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/inspect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,7 @@ class BlockFinder:
10561056
"""Provide a tokeneater() method to detect the end of a code block."""
10571057
def __init__(self):
10581058
self.indent = 0
1059-
self.islambda = False # used also for generator expressions
1059+
self.singleline = False
10601060
self.started = False
10611061
self.passline = False
10621062
self.indecorator = False
@@ -1074,13 +1074,13 @@ def tokeneater(self, type, token, srowcol, erowcol, line):
10741074
# For "def" and "class" scan to the end of the block.
10751075
# For "lambda" and generator expression scan to
10761076
# the end of the logical line.
1077-
self.islambda = token not in ("def", "class")
1077+
self.singleline = token not in ("def", "class")
10781078
self.started = True
10791079
self.passline = True # skip to the end of the line
10801080
elif type == tokenize.NEWLINE:
10811081
self.passline = False # stop skipping when a NEWLINE is seen
10821082
self.last = srowcol[0]
1083-
if self.islambda: # lambdas always end at the first NEWLINE
1083+
if self.singleline:
10841084
raise EndOfBlock
10851085
# hitting a NEWLINE when in a decorator without args
10861086
# ends the decorator

0 commit comments

Comments
 (0)