22
22
from pymongo .errors import ConnectionFailure , InvalidOperation , OperationFailure
23
23
from pymongo .message import _CursorAddress , _GetMore , _RawBatchGetMore
24
24
from pymongo .response import PinnedResponse
25
- from pymongo .typings import _DocumentType
25
+ from pymongo .typings import _Address , _DocumentType
26
26
27
27
if TYPE_CHECKING :
28
28
from pymongo .client_session import ClientSession
@@ -38,7 +38,7 @@ def __init__(
38
38
self ,
39
39
collection : "Collection[_DocumentType]" ,
40
40
cursor_info : Mapping [str , Any ],
41
- address : Optional [Tuple [ str , Optional [ int ]] ],
41
+ address : Optional [_Address ],
42
42
batch_size : int = 0 ,
43
43
max_await_time_ms : Optional [int ] = None ,
44
44
session : Optional ["ClientSession" ] = None ,
@@ -254,7 +254,7 @@ def cursor_id(self) -> int:
254
254
return self .__id
255
255
256
256
@property
257
- def address (self ) -> Optional [Tuple [ str , Optional [ int ]] ]:
257
+ def address (self ) -> Optional [_Address ]:
258
258
"""The (host, port) of the server used, or None.
259
259
260
260
.. versionadded:: 3.0
@@ -309,7 +309,7 @@ def __init__(
309
309
self ,
310
310
collection : "Collection[_DocumentType]" ,
311
311
cursor_info : Mapping [str , Any ],
312
- address : Optional [Tuple [ str , Optional [ int ]] ],
312
+ address : Optional [_Address ],
313
313
batch_size : int = 0 ,
314
314
max_await_time_ms : Optional [int ] = None ,
315
315
session : Optional ["ClientSession" ] = None ,
0 commit comments