2424from typing import (
2525 TYPE_CHECKING ,
2626 Any ,
27- Dict ,
2827 Iterator ,
29- List ,
3028 Mapping ,
3129 NoReturn ,
3230 Optional ,
33- Tuple ,
3431 Type ,
3532 Union ,
3633)
7673_UNKNOWN_ERROR : int = 8
7774_WRITE_CONCERN_ERROR : int = 64
7875
79- _COMMANDS : Tuple [str , str , str ] = ("insert" , "update" , "delete" )
76+ _COMMANDS : tuple [str , str , str ] = ("insert" , "update" , "delete" )
8077
8178
8279class _Run :
@@ -85,8 +82,8 @@ class _Run:
8582 def __init__ (self , op_type : int ) -> None :
8683 """Initialize a new Run object."""
8784 self .op_type : int = op_type
88- self .index_map : List [int ] = []
89- self .ops : List [Any ] = []
85+ self .index_map : list [int ] = []
86+ self .ops : list [Any ] = []
9087 self .idx_offset : int = 0
9188
9289 def index (self , idx : int ) -> int :
@@ -182,7 +179,7 @@ def __init__(
182179 common .validate_is_document_type ("let" , self .let )
183180 self .comment : Optional [str ] = comment
184181 self .ordered = ordered
185- self .ops : List [ Tuple [int , Mapping [str , Any ]]] = []
182+ self .ops : list [ tuple [int , Mapping [str , Any ]]] = []
186183 self .executed = False
187184 self .bypass_doc_val = bypass_document_validation
188185 self .uses_collation = False
@@ -219,12 +216,12 @@ def add_update(
219216 multi : bool = False ,
220217 upsert : bool = False ,
221218 collation : Optional [Mapping [str , Any ]] = None ,
222- array_filters : Optional [List [Mapping [str , Any ]]] = None ,
219+ array_filters : Optional [list [Mapping [str , Any ]]] = None ,
223220 hint : Union [str , SON [str , Any ], None ] = None ,
224221 ) -> None :
225222 """Create an update document and add it to the list of ops."""
226223 validate_ok_for_update (update )
227- cmd : Dict [str , Any ] = dict (
224+ cmd : dict [str , Any ] = dict (
228225 [("q" , selector ), ("u" , update ), ("multi" , multi ), ("upsert" , upsert )]
229226 )
230227 if collation is not None :
@@ -414,7 +411,7 @@ def execute_command(
414411 generator : Iterator [Any ],
415412 write_concern : WriteConcern ,
416413 session : Optional [ClientSession ],
417- ) -> Dict [str , Any ]:
414+ ) -> dict [str , Any ]:
418415 """Execute using write commands."""
419416 # nModified is only reported for write commands, not legacy ops.
420417 full_result = {
0 commit comments