You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Bugs in long-literal handlin
Move n_dict to n_actions and special case n_const_list. Generalize build_collection out of 3.7+ and into all Pythons
This commit is contained in:
BIN
test/bytecode_3.8_run/05_long_literals.pyc
Normal file
BIN
test/bytecode_3.8_run/05_long_literals.pyc
Normal file
Binary file not shown.
@@ -1306,7 +1306,7 @@ assert tuple(x.keys()) == (1, 3)
|
||||
# Try a long dictionary.
|
||||
# This should not be slow as it has been in the past
|
||||
values = {
|
||||
"valuea": a + 1,
|
||||
"value1": x,
|
||||
"value2": 2 + 1,
|
||||
"value3": 3 + 1,
|
||||
"value4": 4 + 1,
|
||||
@@ -1811,3 +1811,46 @@ values = {
|
||||
}
|
||||
|
||||
assert list(values.values()) == list(range(2, 502 + 2))
|
||||
|
||||
|
||||
# Try a long dictionary that fails because we have a binary op.
|
||||
# We can get a expr32 grouping speedup
|
||||
# which is slower than if this were all constant.
|
||||
# The above was not implemented at the time this test was written.
|
||||
values = {
|
||||
"value1": x + 1, # This is a binary op not consant
|
||||
"value2": 2,
|
||||
"value3": 3,
|
||||
"value4": 4,
|
||||
"value5": 5,
|
||||
"value6": 6,
|
||||
"value7": 7,
|
||||
"value8": 8,
|
||||
"value9": 9,
|
||||
"value10": 10,
|
||||
"value11": 11,
|
||||
"value12": 12,
|
||||
"value13": 13,
|
||||
"value14": 14,
|
||||
"value15": 15,
|
||||
"value16": 16,
|
||||
"value17": 17,
|
||||
"value18": 18,
|
||||
"value19": 19,
|
||||
"value20": 20,
|
||||
"value21": 21,
|
||||
"value22": 22,
|
||||
"value23": 23,
|
||||
"value24": 24,
|
||||
"value25": 25,
|
||||
"value26": 26,
|
||||
"value27": 27,
|
||||
"value28": 28,
|
||||
"value29": 29,
|
||||
"value30": 30,
|
||||
"value31": 31,
|
||||
"value32": 32,
|
||||
"value33": 33,
|
||||
}
|
||||
|
||||
assert list(values.values()) == list(range(2, 502 + 2))
|
||||
|
Reference in New Issue
Block a user