Created
September 4, 2020 16:49
-
-
Save 17183248569/f0ccdde65dfbd1e28869ac71bef1f09e to your computer and use it in GitHub Desktop.
[] -> ()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(): | |
import marshal | |
tuplis=[] | |
def ltot(inpl): | |
if id(inpl) in tuplis: | |
return b"r"+tuplis.index(id(inpl)).to_bytes(4,"little") | |
else: | |
tuplis.append(id(inpl)) | |
ret=b"\xa9"+len(inpl).to_bytes(1,"little") | |
for i in inpl: | |
ret+=ltot(i) | |
return ret | |
def conv(inpl): | |
tuplis.clear() | |
return marshal.loads(ltot(inpl)) | |
return conv | |
conv=f() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment