Skip to content

Commit 126efb9

Browse files
committed
use list, dict instead of typing
1 parent 354d228 commit 126efb9

File tree

1 file changed

+13
-13
lines changed
  • py/selenium/webdriver/common/bidi

1 file changed

+13
-13
lines changed

py/selenium/webdriver/common/bidi/input.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import math
1919
from dataclasses import dataclass, field
20-
from typing import Any, Dict, List, Optional, Union
20+
from typing import Any, Optional, Union
2121

2222
from selenium.webdriver.common.bidi.common import command_builder
2323
from selenium.webdriver.common.bidi.session import Session
@@ -101,7 +101,7 @@ def __post_init__(self):
101101

102102
def to_dict(self) -> dict:
103103
"""Convert the PointerCommonProperties to a dictionary."""
104-
result: Dict[str, Any] = {}
104+
result: dict[str, Any] = {}
105105
if self.width != 1:
106106
result["width"] = self.width
107107
if self.height != 1:
@@ -132,7 +132,7 @@ def type(self) -> str:
132132

133133
def to_dict(self) -> dict:
134134
"""Convert the PauseAction to a dictionary."""
135-
result: Dict[str, Any] = {"type": self.type}
135+
result: dict[str, Any] = {"type": self.type}
136136
if self.duration is not None:
137137
result["duration"] = self.duration
138138
return result
@@ -181,7 +181,7 @@ def type(self) -> str:
181181

182182
def to_dict(self) -> dict:
183183
"""Convert the PointerDownAction to a dictionary."""
184-
result: Dict[str, Any] = {"type": self.type, "button": self.button}
184+
result: dict[str, Any] = {"type": self.type, "button": self.button}
185185
if self.properties:
186186
result.update(self.properties.to_dict())
187187
return result
@@ -218,7 +218,7 @@ def type(self) -> str:
218218

219219
def to_dict(self) -> dict:
220220
"""Convert the PointerMoveAction to a dictionary."""
221-
result: Dict[str, Any] = {"type": self.type, "x": self.x, "y": self.y}
221+
result: dict[str, Any] = {"type": self.type, "x": self.x, "y": self.y}
222222
if self.duration is not None:
223223
result["duration"] = self.duration
224224
if self.origin is not None:
@@ -248,7 +248,7 @@ def type(self) -> str:
248248

249249
def to_dict(self) -> dict:
250250
"""Convert the WheelScrollAction to a dictionary."""
251-
result: Dict[str, Any] = {
251+
result: dict[str, Any] = {
252252
"type": self.type,
253253
"x": self.x,
254254
"y": self.y,
@@ -271,7 +271,7 @@ class NoneSourceActions:
271271
"""Represents a sequence of none actions."""
272272

273273
id: str = ""
274-
actions: List[PauseAction] = field(default_factory=list)
274+
actions: list[PauseAction] = field(default_factory=list)
275275

276276
@property
277277
def type(self) -> str:
@@ -287,7 +287,7 @@ class KeySourceActions:
287287
"""Represents a sequence of key actions."""
288288

289289
id: str = ""
290-
actions: List[Union[PauseAction, KeyDownAction, KeyUpAction]] = field(default_factory=list)
290+
actions: list[Union[PauseAction, KeyDownAction, KeyUpAction]] = field(default_factory=list)
291291

292292
@property
293293
def type(self) -> str:
@@ -304,7 +304,7 @@ class PointerSourceActions:
304304

305305
id: str = ""
306306
parameters: Optional[PointerParameters] = None
307-
actions: List[Union[PauseAction, PointerDownAction, PointerUpAction, PointerMoveAction]] = field(
307+
actions: list[Union[PauseAction, PointerDownAction, PointerUpAction, PointerMoveAction]] = field(
308308
default_factory=list
309309
)
310310

@@ -318,7 +318,7 @@ def type(self) -> str:
318318

319319
def to_dict(self) -> dict:
320320
"""Convert the PointerSourceActions to a dictionary."""
321-
result: Dict[str, Any] = {
321+
result: dict[str, Any] = {
322322
"type": self.type,
323323
"id": self.id,
324324
"actions": [action.to_dict() for action in self.actions],
@@ -333,7 +333,7 @@ class WheelSourceActions:
333333
"""Represents a sequence of wheel actions."""
334334

335335
id: str = ""
336-
actions: List[Union[PauseAction, WheelScrollAction]] = field(default_factory=list)
336+
actions: list[Union[PauseAction, WheelScrollAction]] = field(default_factory=list)
337337

338338
@property
339339
def type(self) -> str:
@@ -392,7 +392,7 @@ def __init__(self, conn):
392392
def perform_actions(
393393
self,
394394
context: str,
395-
actions: List[Union[NoneSourceActions, KeySourceActions, PointerSourceActions, WheelSourceActions]],
395+
actions: list[Union[NoneSourceActions, KeySourceActions, PointerSourceActions, WheelSourceActions]],
396396
) -> None:
397397
"""Performs a sequence of user input actions.
398398
@@ -414,7 +414,7 @@ def release_actions(self, context: str) -> None:
414414
params = {"context": context}
415415
self.conn.execute(command_builder("input.releaseActions", params))
416416

417-
def set_files(self, context: str, element: dict, files: List[str]) -> None:
417+
def set_files(self, context: str, element: dict, files: list[str]) -> None:
418418
"""Sets files for a file input element.
419419
420420
Parameters:

0 commit comments

Comments
 (0)