@@ -93,7 +93,7 @@ class XProxy(MutableMappingRole, AsyncContextManagerRole):
9393)
9494from contextlib import AbstractAsyncContextManager , AbstractContextManager
9595from functools import wraps
96- from types import GetSetDescriptorType , TracebackType
96+ from types import CoroutineType , GetSetDescriptorType , TracebackType
9797from typing import (
9898 Any ,
9999 Callable ,
@@ -479,21 +479,21 @@ def _get_generator(self) -> AsyncGenerator[T_co, T_contra]:
479479 obj = self ._get_current_object () # type: ignore
480480 return cast (AsyncGenerator [T_co , T_contra ], obj )
481481
482- def __anext__ (self ) -> Awaitable [ T_co ]:
482+ def __anext__ (self ) -> CoroutineType [ Any , Any , T_co ]:
483483 return self ._get_generator ().__anext__ ()
484484
485- def asend (self , value : T_contra ) -> Awaitable [ T_co ]:
485+ def asend (self , value : T_contra ) -> CoroutineType [ Any , Any , T_co ]:
486486 return self ._get_generator ().asend (value )
487487
488488 def athrow (
489489 self ,
490490 typ : type [BaseException ],
491491 val : Optional [BaseException ] = None ,
492492 tb : Optional [TracebackType ] = None ,
493- ) -> Awaitable [ T_co ]:
493+ ) -> CoroutineType [ Any , Any , T_co ]:
494494 return self ._get_generator ().athrow (typ , val , tb )
495495
496- def aclose (self ) -> Awaitable [ None ]:
496+ def aclose (self ) -> CoroutineType [ Any , Any , None ]:
497497 return self ._get_generator ().aclose ()
498498
499499 def __aiter__ (self ) -> AsyncGenerator [T_co , T_contra ]:
@@ -514,7 +514,7 @@ def _get_sequence(self) -> Sequence[T_co]:
514514 return cast (Sequence [T_co ], obj )
515515
516516 @overload
517- def __getitem__ (self , i : int ) -> T_co : ...
517+ def __getitem__ (self , s : int ) -> T_co : ...
518518
519519 @overload
520520 def __getitem__ (self , s : slice ) -> MutableSequence [T_co ]: ...
@@ -556,13 +556,13 @@ def insert(self, index: int, object: T) -> None:
556556 self ._get_sequence ().insert (index , object )
557557
558558 @overload
559- def __setitem__ (self , i : int , o : T ) -> None : ...
559+ def __setitem__ (self , s : int , o : T ) -> None : ...
560560
561561 @overload
562562 def __setitem__ (self , s : slice , o : Iterable [T ]) -> None : ...
563563
564- def __setitem__ (self , index_or_slice : Any , o : Any ) -> None :
565- self ._get_sequence ().__setitem__ (index_or_slice , o )
564+ def __setitem__ (self , s : Any , o : Any ) -> None :
565+ self ._get_sequence ().__setitem__ (s , o )
566566
567567 @overload
568568 def __delitem__ (self , i : int ) -> None : ...
@@ -708,19 +708,19 @@ class ContextManagerProxy(
708708class AsyncContextManagerRole (AbstractAsyncContextManager [T_co ]):
709709 """Role/Mixin for `contextlib.AbstractAsyncContextManager` proxy methods."""
710710
711- def __aenter__ (self ) -> Awaitable [ T_co ]:
711+ def __aenter__ (self ) -> CoroutineType [ Any , Any , T_co ]:
712712 obj = self ._get_current_object () # type: ignore
713- return cast (Awaitable [ T_co ], obj .__aenter__ ())
713+ return cast (CoroutineType [ Any , Any , T_co ], obj .__aenter__ ())
714714
715715 def __aexit__ (
716716 self ,
717717 exc_type : Optional [type [BaseException ]],
718718 exc_value : Optional [BaseException ],
719719 traceback : Optional [TracebackType ],
720- ) -> Awaitable [ Optional [bool ]]:
720+ ) -> CoroutineType [ Any , Any , Optional [bool ]]:
721721 obj = self ._get_current_object () # type: ignore
722722 val = obj .__aexit__ (exc_type , exc_value , traceback )
723- return cast (Awaitable [ Optional [bool ]], val )
723+ return cast (CoroutineType [ Any , Any , Optional [bool ]], val )
724724
725725
726726class AsyncContextManagerProxy (
0 commit comments