Skip to content

Commit e142d5d

Browse files
committed
[py]: additional type hints for interaction.py
1 parent ab901a5 commit e142d5d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

py/selenium/webdriver/common/actions/interaction.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
17+
import typing
1818

1919
KEY = "key"
2020
POINTER = "pointer"
@@ -33,18 +33,17 @@ class Interaction:
3333

3434
PAUSE = "pause"
3535

36-
def __init__(self, source):
36+
def __init__(self, source) -> None:
3737
self.source = source
3838

3939

4040
class Pause(Interaction):
4141

42-
def __init__(self, source, duration=0):
43-
super(Interaction, self).__init__()
44-
self.source = source
42+
def __init__(self, source, duration: float = 0) -> None:
43+
super().__init__(source)
4544
self.duration = duration
4645

47-
def encode(self):
46+
def encode(self) -> typing.Dict[str, typing.Union[str, int]]:
4847
return {
4948
"type": self.PAUSE,
5049
"duration": int(self.duration * 1000)

0 commit comments

Comments
 (0)