Skip to content

Commit ad60919

Browse files
authored
[aiotools.fs] tighter type on AsyncFS.__aenter__ (#14346)
In particular, this allows `async with RouterAsyncFS(...) as fs` to give a tight type to `fs`.
1 parent fbd22a3 commit ad60919

File tree

1 file changed

+2
-2
lines changed
  • hail/python/hailtop/aiotools/fs

1 file changed

+2
-2
lines changed

hail/python/hailtop/aiotools/fs/fs.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Union,
1414
Tuple,
1515
)
16-
from typing_extensions import ParamSpec
16+
from typing_extensions import ParamSpec, Self
1717
from types import TracebackType
1818
import abc
1919
import asyncio
@@ -426,7 +426,7 @@ async def exists(self, url: str) -> bool:
426426
async def close(self) -> None:
427427
pass
428428

429-
async def __aenter__(self) -> "AsyncFS":
429+
async def __aenter__(self) -> Self:
430430
return self
431431

432432
async def __aexit__(

0 commit comments

Comments
 (0)