aio-libs / aiobotocore

asyncio support for botocore library using aiohttp
https://aiobotocore.aio-libs.org
Apache License 2.0
1.16k stars 182 forks source link

swap to bytecode patching? #826

Closed thehesiod closed 2 weeks ago

thehesiod commented 4 years ago

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 commented 4 years ago

@terrycain thoughts?

thehesiod commented 4 years ago

@jettify ?

graingert commented 4 years ago

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

thehesiod commented 4 years ago

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

terricain commented 4 years ago

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

thehesiod commented 4 years ago

@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 commented 4 years ago

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.

github-actions[bot] commented 3 weeks ago

This issue has been marked as stale because it has been inactive for more than 60 days. Please update this pull request or it will be automatically closed in 7 days.