@@ -71,8 +71,7 @@ You can define your own protocol class by inheriting from the special
7171
7272.. code-block :: python
7373
74- from typing import Iterable
75- from typing_extensions import Protocol
74+ from typing import Iterable, Protocol
7675
7776 class SupportsClose (Protocol ):
7877 # Empty method body (explicit '...')
@@ -231,8 +230,7 @@ such as trees and linked lists:
231230
232231.. code-block :: python
233232
234- from typing import TypeVar, Optional
235- from typing_extensions import Protocol
233+ from typing import TypeVar, Optional, Protocol
236234
237235 class TreeLike (Protocol ):
238236 value: int
@@ -260,7 +258,7 @@ rudimentary support for runtime structural checks:
260258
261259.. code-block :: python
262260
263- from typing_extensions import Protocol, runtime_checkable
261+ from typing import Protocol, runtime_checkable
264262
265263 @runtime_checkable
266264 class Portable (Protocol ):
@@ -303,8 +301,7 @@ member:
303301
304302.. code-block :: python
305303
306- from typing import Optional, Iterable
307- from typing_extensions import Protocol
304+ from typing import Optional, Iterable, Protocol
308305
309306 class Combiner (Protocol ):
310307 def __call__ (self , * vals : bytes , maxlen : Optional[int ] = None ) -> list[bytes ]: ...
@@ -328,8 +325,7 @@ a double underscore prefix is used. For example:
328325
329326.. code-block :: python
330327
331- from typing import Callable, TypeVar
332- from typing_extensions import Protocol
328+ from typing import Callable, TypeVar, Protocol
333329
334330 T = TypeVar(' T' )
335331
0 commit comments