Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9fc1238

Browse filesBrowse files
committed
pythongh-127648: Improve Python startup time by ~12%
1 parent ea8ec95 commit 9fc1238
Copy full SHA for 9fc1238

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎Lib/io.py

Copy file name to clipboardExpand all lines: Lib/io.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
import _io
5454
import abc
5555

56-
from _collections_abc import _check_methods
5756
from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, UnsupportedOperation,
5857
open, open_code, FileIO, BytesIO, StringIO, BufferedReader,
5958
BufferedWriter, BufferedRWPair, BufferedRandom,
@@ -126,6 +125,7 @@ def read(self, size=..., /):
126125
@classmethod
127126
def __subclasshook__(cls, C):
128127
if cls is Reader:
128+
from _collections_abc import _check_methods
129129
return _check_methods(C, "read")
130130
return NotImplemented
131131

@@ -147,6 +147,7 @@ def write(self, data, /):
147147
@classmethod
148148
def __subclasshook__(cls, C):
149149
if cls is Writer:
150+
from _collections_abc import _check_methods
150151
return _check_methods(C, "write")
151152
return NotImplemented
152153

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.