Port over some recent decompyle3 3.8 fixes

This commit is contained in:
rocky
2022-06-26 04:26:15 -04:00
parent 7f798541f0
commit 85ba8352ba
7 changed files with 219 additions and 5 deletions

Binary file not shown.

View File

@@ -14,6 +14,12 @@ assert (
assert "def0" == f"{abc}0"
assert "defdef" == f"{abc}{abc!s}"
# From 3.8 test/test_string.py
# We had the precedence of yield vs. lambda incorrect.
def fn(x):
yield f"x:{yield (lambda i: x * i)}"
# From 3.6 functools.py
# Bug was handling format operator strings.

View File

@@ -0,0 +1,12 @@
# Issue 104
# Python 3.8 reverses the order or keys and values in
# dictionary comprehensions from the order in all previous Pythons.
# Also we were looking in the wrong place for the collection of the
# dictionary comprehension
# RUNNABLE!
"""This program is self-checking!"""
x = [(0, [1]), (2, [3])]
for i in range(0, 1):
y = {key: val[i - 1] for (key, val) in x}
assert y == {0: 1, 2: 3}