Skip to content

Commit 5151b8d

Browse files
committed
Add type hint and docstring to __eq__ method in ScriptKey class for clarity on equality comparison
1 parent 362ce0a commit 5151b8d

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

py/selenium/webdriver/remote/script_key.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,21 @@ def __init__(self, id=None):
2626
def id(self):
2727
return self._id
2828

29-
def __eq__(self, other):
29+
def __eq__(self, other) -> bool:
30+
"""Compare this ScriptKey with another object for equality.
31+
32+
Args:
33+
other: The object to compare with.
34+
35+
Returns:
36+
True if the script key ID equals the other object, False otherwise.
37+
"""
3038
return self._id == other
3139

3240
def __repr__(self) -> str:
41+
"""Return a string representation of the ScriptKey object.
42+
43+
Returns:
44+
A string representation showing the script key ID.
45+
"""
3346
return f"ScriptKey(id={self.id})"

0 commit comments

Comments
 (0)