1616# under the License.
1717
1818from dataclasses import dataclass
19- from typing import Any , Dict , List , Optional
19+ from typing import Any , Optional
2020
2121from selenium .webdriver .common .bidi .common import command_builder
2222
@@ -55,7 +55,7 @@ class RealmInfo:
5555 sandbox : Optional [str ] = None
5656
5757 @classmethod
58- def from_json (cls , json : Dict [str , Any ]) -> "RealmInfo" :
58+ def from_json (cls , json : dict [str , Any ]) -> "RealmInfo" :
5959 """Creates a RealmInfo instance from a dictionary.
6060
6161 Parameters:
@@ -90,7 +90,7 @@ class Source:
9090 context : Optional [str ] = None
9191
9292 @classmethod
93- def from_json (cls , json : Dict [str , Any ]) -> "Source" :
93+ def from_json (cls , json : dict [str , Any ]) -> "Source" :
9494 """Creates a Source instance from a dictionary.
9595
9696 Parameters:
@@ -120,7 +120,7 @@ class EvaluateResult:
120120 exception_details : Optional [dict ] = None
121121
122122 @classmethod
123- def from_json (cls , json : Dict [str , Any ]) -> "EvaluateResult" :
123+ def from_json (cls , json : dict [str , Any ]) -> "EvaluateResult" :
124124 """Creates an EvaluateResult instance from a dictionary.
125125
126126 Parameters:
@@ -155,7 +155,7 @@ def __init__(self, channel: str, data: dict, source: Source):
155155 self .source = source
156156
157157 @classmethod
158- def from_json (cls , json : Dict [str , Any ]) -> "ScriptMessage" :
158+ def from_json (cls , json : dict [str , Any ]) -> "ScriptMessage" :
159159 """Creates a ScriptMessage instance from a dictionary.
160160
161161 Parameters:
@@ -189,7 +189,7 @@ def __init__(self, realm_info: RealmInfo):
189189 self .realm_info = realm_info
190190
191191 @classmethod
192- def from_json (cls , json : Dict [str , Any ]) -> "RealmCreated" :
192+ def from_json (cls , json : dict [str , Any ]) -> "RealmCreated" :
193193 """Creates a RealmCreated instance from a dictionary.
194194
195195 Parameters:
@@ -212,7 +212,7 @@ def __init__(self, realm: str):
212212 self .realm = realm
213213
214214 @classmethod
215- def from_json (cls , json : Dict [str , Any ]) -> "RealmDestroyed" :
215+ def from_json (cls , json : dict [str , Any ]) -> "RealmDestroyed" :
216216 """Creates a RealmDestroyed instance from a dictionary.
217217
218218 Parameters:
@@ -262,9 +262,9 @@ def remove_console_message_handler(self, id):
262262 def _add_preload_script (
263263 self ,
264264 function_declaration : str ,
265- arguments : Optional [List [ Dict [str , Any ]]] = None ,
266- contexts : Optional [List [str ]] = None ,
267- user_contexts : Optional [List [str ]] = None ,
265+ arguments : Optional [list [ dict [str , Any ]]] = None ,
266+ contexts : Optional [list [str ]] = None ,
267+ user_contexts : Optional [list [str ]] = None ,
268268 sandbox : Optional [str ] = None ,
269269 ) -> str :
270270 """Adds a preload script.
@@ -288,7 +288,7 @@ def _add_preload_script(
288288 if contexts is not None and user_contexts is not None :
289289 raise ValueError ("Cannot specify both contexts and user_contexts" )
290290
291- params : Dict [str , Any ] = {"functionDeclaration" : function_declaration }
291+ params : dict [str , Any ] = {"functionDeclaration" : function_declaration }
292292
293293 if arguments is not None :
294294 params ["arguments" ] = arguments
@@ -312,7 +312,7 @@ def _remove_preload_script(self, script_id: str) -> None:
312312 params = {"script" : script_id }
313313 self .conn .execute (command_builder ("script.removePreloadScript" , params ))
314314
315- def _disown (self , handles : List [str ], target : dict ) -> None :
315+ def _disown (self , handles : list [str ], target : dict ) -> None :
316316 """Disowns the given handles.
317317
318318 Parameters:
@@ -331,7 +331,7 @@ def _call_function(
331331 function_declaration : str ,
332332 await_promise : bool ,
333333 target : dict ,
334- arguments : Optional [List [dict ]] = None ,
334+ arguments : Optional [list [dict ]] = None ,
335335 result_ownership : Optional [str ] = None ,
336336 serialization_options : Optional [dict ] = None ,
337337 this : Optional [dict ] = None ,
@@ -416,7 +416,7 @@ def _get_realms(
416416 self ,
417417 context : Optional [str ] = None ,
418418 type : Optional [str ] = None ,
419- ) -> List [RealmInfo ]:
419+ ) -> list [RealmInfo ]:
420420 """Returns a list of all realms, optionally filtered.
421421
422422 Parameters:
0 commit comments