asottile / pyupgrade

A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
MIT License
3.5k stars 177 forks source link

Convert `__anext__` calls on Python 3.10+ #960

Open DarkLight1337 opened 1 month ago

DarkLight1337 commented 1 month ago

Python 3.10 introduces the anext builtin which calls __anext__ on the provided async iterator. It would be great if pyupgrade could automatically convert legacy async_iterator.__anext__() calls into anext(async_iterator) upon upgrading to Python 3.10 or above.