diff --git a/README.md b/README.md index 07fcfa2..f9fa3b1 100644 --- a/README.md +++ b/README.md @@ -294,6 +294,16 @@ With `--py36-plus` and higher, `reorder-python-imports` will also rewrite +from typing import TypedDict ``` +## Rewriting `async_timeout` imports + +With `--py311-plus` and higher, `reorder-python-imports` will also rewrite +`async_timeout` imports which moved to `asyncio`. + +```diff +-from async_timeout import timeout ++from asyncio import timeout +``` + ## Rewriting pep 585 typing imports With `--py39-plus` and higher, `reorder-python-imports` will replace imports diff --git a/reorder_python_imports.py b/reorder_python_imports.py index c6d1f57..498181a 100644 --- a/reorder_python_imports.py +++ b/reorder_python_imports.py @@ -499,6 +499,8 @@ def _fix_file( 'typing_extensions=typing:is_typeddict', )) REPLACES[(3, 11)].update(( + 'async_timeout=asyncio:timeout', + 'async_timeout=asyncio:timeout_at', 'typing_extensions=typing:Any', 'typing_extensions=typing:LiteralString', 'typing_extensions=typing:Never',