-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payload registry has to do a linear search to find payloads #9419
Comments
Doesn't really work, because it works with isinstance checks, which could be a subclass or an abc. I thought about this previously and didn't think of any improvements. Not sure what zope.interface is though, might be worth looking into. |
Maybe if we have a property that is a key thats the same for the subclassed object.. not sure if that will work. Needs some more thought. |
Not sure what you mean, the subclasses are e.g. subclass of bytes or (more realistically) a subclass of io.BufferedIO. They are not our classes, just arbitrary types that might be used to store/stream data. |
I need to dig at it a bit more to come up with a solution. This one will take a bit of thought so I opened the issue so I don't forget to come back to it. |
aiohttp/aiohttp/payload.py
Line 97 in 21f5f92
There is a note that its inefficent.
We might be able to clean it up by giving each payload a key as part of the base class and then doing a dict lookup instead
The text was updated successfully, but these errors were encountered: