gh-105013: Fix inspect.getsource with parenthesized multiline lambdas (#105021)

This commit is contained in:
Pablo Galindo Salgado 2023-05-28 00:20:42 +01:00 committed by GitHub
parent b225c08de8
commit 3a5be878be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 0 deletions

View file

@ -273,3 +273,20 @@ def deco_factory(**kwargs):
@deco_factory(foo=(1 + 2), bar=lambda: 1)
def complex_decorated(foo=0, bar=lambda: 0):
return foo + bar()
# line 276
parenthesized_lambda = (
lambda: ())
parenthesized_lambda2 = [
lambda: ()][0]
parenthesized_lambda3 = {0:
lambda: ()}[0]
# line 285
post_line_parenthesized_lambda1 = (lambda: ()
)
# line 289
nested_lambda = (
lambda right: [].map(
lambda length: ()))