Skip to content

Commit 627eec7

Browse files
kovanclaude
andcommitted
Add asyncio async file I/O with open_file, AsyncFile, wrap_file, and Path
Adds thread-delegated async file I/O to asyncio, following proven Trio/anyio patterns. open_file() and AsyncFile wrap synchronous file objects with async methods via asyncio.to_thread(). Path wraps pathlib.Path with async I/O methods and sync property passthrough. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 72eca2a commit 627eec7

3 files changed

Lines changed: 1018 additions & 1 deletion

File tree

Lib/asyncio/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from .timeouts import *
2323
from .threads import *
2424
from .transports import *
25+
from .fileio import *
2526

2627
__all__ = (base_events.__all__ +
2728
coroutines.__all__ +
@@ -39,7 +40,8 @@
3940
taskgroups.__all__ +
4041
threads.__all__ +
4142
timeouts.__all__ +
42-
transports.__all__)
43+
transports.__all__ +
44+
fileio.__all__)
4345

4446
if sys.platform == 'win32': # pragma: no cover
4547
from .windows_events import *

0 commit comments

Comments
 (0)