aiobotocore icon indicating copy to clipboard operation
aiobotocore copied to clipboard

swap to bytecode patching?

Open thehesiod opened this issue 5 years ago • 7 comments

Instead of us generating tons of copy/pasted code for sections where we're only adding an await perhaps we should think about swapping to bytecode patching. There are helpers like bytecode and codetransformer that could help

the worry I would have is for debugging. As long as it would match up line for line I think it would be ok, definitely would be a little weird ;)

thehesiod avatar Aug 31 '20 23:08 thehesiod

@terrycain thoughts?

thehesiod avatar Aug 31 '20 23:08 thehesiod

@jettify ?

thehesiod avatar Aug 31 '20 23:08 thehesiod

@thehesiod I strongly recommend going the other way around with https://pypi.org/project/unasync/ and having botocore be generated from aiobotocore

graingert avatar Sep 08 '20 22:09 graingert

we can't generate botocore from aiobotocore, botocore is the truth, aiobotocore is a third party enhancement

thehesiod avatar Sep 08 '20 22:09 thehesiod

Got any references/examples of it? sounds cool/scary/error-prone :smile:

terricain avatar Sep 08 '20 22:09 terricain

@terrycain exactly, lol I was looking at this: https://rushter.com/blog/python-bytecode-patch/ that referenced those modules, I need to spend some time to play around with it

thehesiod avatar Sep 08 '20 23:09 thehesiod

I think it combined with the patch checker would be ok, but ya debugging would suk, unless we generate python code from the bytecode and add them as reference files, actually that would be cool.

thehesiod avatar Sep 08 '20 23:09 thehesiod