asottile / pyupgrade

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

Convert `__anext__` calls on Python 3.10+ #960

Open DarkLight1337 opened 3 months ago

DarkLight1337 commented 3 months 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.