Sync with decompyle3

This commit is contained in:
rocky
2022-09-17 10:13:27 -04:00
parent a68f440d6f
commit 600688a65d
4 changed files with 58 additions and 17 deletions

Binary file not shown.

View File

@@ -59,9 +59,9 @@ log_rounds = 5
assert "05$" == f"{log_rounds:02d}$"
def testit(a, b, l):
# print(l)
return l
def testit(a, b, ll):
# print(ll)
return ll
# The call below shows the need for BUILD_STRING to count expr arguments.
@@ -102,11 +102,11 @@ assert f"x={x*y:{width}}" == "x=foofoo "
# equivalent thing. For compatiblity with older Python we'll use "%"
# instead of a format string
def f():
f"""Not a docstring"""
f"""Not a docstring""" # noqa
def g():
"""Not a docstring""" f""
"""Not a docstring""" f"" # noqa
assert f.__doc__ is None
@@ -129,3 +129,17 @@ assert f'{f"{0}"*3}' == "000"
# The former, {{ confuses the format strings so dictionary/set comprehensions
# don't work.
assert f"expr={ {x: y for x, y in [(1, 2), ]}}" == "expr={1: 2}"
class Line:
def __init__(self, x, y):
self.x = x
self.y = y
# From 3.7 test_typing.py
def __str__(self):
return f"{self.x} -> {self.y}"
line = Line(1, 2)
assert str(line) == "1 -> 2"