Open olii opened 5 months ago
This may improve this situation but make other situations worse. So it may be that tests on both the bytecode version and Python version may need to be done.
Also, we might want to jigger things in xdis rather than here.
Let me think about this one.
In thinking more about this, I think the change is more appropriately made in xdis, not here.
The order that set items should appear is the order in which they items appear in marshal data.
Since Python 3.1, there is OrderedDict. And that is what should be used for those versions of Python that support this.
The order that set items should appear is the order in which they items appear in marshal data.
I agree, however, is there a way to parse the value in xdis and store it like some other type, in this case OrderedDict
? Is there anything similar already?
The order that set items should appear is the order in which they items appear in marshal data.
I agree, however, is there a way to parse the value in xdis and store it like some other type, in this case
OrderedDict
? Is there anything similar already?
Yes, this would all be done inside xdis.
This PR attempts to fix the decompilation of simple sets defined as
LOAD_CONST
. Sets were decompiled correctly but the order of elements was not defined.Test input
This was my test input compiled by the Python 3.6:
Disassembly
Decompilation outputs before patch
Attempt n. 1:
Attempt n. 2:
Decompilation output after patch