Skip to content

Commit e2a127e

Browse files
committed
Fix type hints with default nulls - all remaining
Used regex for search: : \w+ = None
1 parent fa11762 commit e2a127e

File tree

16 files changed

+44
-31
lines changed

16 files changed

+44
-31
lines changed

py/selenium/webdriver/chrome/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(
4040
executable_path=None,
4141
port: int = 0,
4242
service_args: Optional[List[str]] = None,
43-
log_output: SubprocessStdAlias = None,
43+
log_output: Optional[SubprocessStdAlias] = None,
4444
env: Optional[Mapping[str, str]] = None,
4545
**kwargs,
4646
) -> None:

py/selenium/webdriver/chromium/service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class ChromiumService(service.Service):
3737

3838
def __init__(
3939
self,
40-
executable_path: str = None,
40+
executable_path: Optional[str] = None,
4141
port: int = 0,
4242
service_args: Optional[List[str]] = None,
43-
log_output: SubprocessStdAlias = None,
43+
log_output: Optional[SubprocessStdAlias] = None,
4444
env: Optional[Mapping[str, str]] = None,
45-
driver_path_env_key: str = None,
45+
driver_path_env_key: Optional[str] = None,
4646
**kwargs,
4747
) -> None:
4848
self.service_args = service_args or []

py/selenium/webdriver/common/actions/wheel_actions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
18+
from typing import Optional
19+
1720
from .interaction import Interaction
1821
from .wheel_input import WheelInput
1922

2023

2124
class WheelActions(Interaction):
22-
def __init__(self, source: WheelInput = None):
25+
def __init__(self, source: Optional[WheelInput] = None):
2326
if not source:
2427
source = WheelInput("wheel")
2528
super().__init__(source)

py/selenium/webdriver/common/service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ class Service(ABC):
5555

5656
def __init__(
5757
self,
58-
executable_path: str = None,
58+
executable_path: Optional[str] = None,
5959
port: int = 0,
60-
log_output: SubprocessStdAlias = None,
60+
log_output: Optional[SubprocessStdAlias] = None,
6161
env: Optional[Mapping[Any, Any]] = None,
62-
driver_path_env_key: str = None,
62+
driver_path_env_key: Optional[str] = None,
6363
**kwargs,
6464
) -> None:
6565
if isinstance(log_output, str):

py/selenium/webdriver/edge/service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class Service(service.ChromiumService):
3737

3838
def __init__(
3939
self,
40-
executable_path: str = None,
40+
executable_path: Optional[str] = None,
4141
port: int = 0,
42-
log_output: SubprocessStdAlias = None,
42+
log_output: Optional[SubprocessStdAlias] = None,
4343
service_args: Optional[List[str]] = None,
4444
env: Optional[Mapping[str, str]] = None,
45-
driver_path_env_key: str = None,
45+
driver_path_env_key: Optional[str] = None,
4646
**kwargs,
4747
) -> None:
4848
self.service_args = service_args or []

py/selenium/webdriver/edge/webdriver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
from typing import Optional
19+
1820
from selenium.webdriver.chromium.webdriver import ChromiumDriver
1921
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
2022

@@ -27,8 +29,8 @@ class WebDriver(ChromiumDriver):
2729

2830
def __init__(
2931
self,
30-
options: Options = None,
31-
service: Service = None,
32+
options: Optional[Options] = None,
33+
service: Optional[Service] = None,
3234
keep_alive: bool = True,
3335
) -> None:
3436
"""Creates a new instance of the edge driver. Starts the service and

py/selenium/webdriver/firefox/service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class Service(service.Service):
3737

3838
def __init__(
3939
self,
40-
executable_path: str = None,
40+
executable_path: Optional[str] = None,
4141
port: int = 0,
4242
service_args: Optional[List[str]] = None,
43-
log_output: SubprocessStdAlias = None,
43+
log_output: Optional[SubprocessStdAlias] = None,
4444
env: Optional[Mapping[str, str]] = None,
45-
driver_path_env_key: str = None,
45+
driver_path_env_key: Optional[str] = None,
4646
**kwargs,
4747
) -> None:
4848
self.service_args = service_args or []

py/selenium/webdriver/firefox/webdriver.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import zipfile
2121
from contextlib import contextmanager
2222
from io import BytesIO
23+
from typing import Optional
2324

2425
from selenium.webdriver.common.driver_finder import DriverFinder
2526
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
@@ -37,8 +38,8 @@ class WebDriver(RemoteWebDriver):
3738

3839
def __init__(
3940
self,
40-
options: Options = None,
41-
service: Service = None,
41+
options: Optional[Options] = None,
42+
service: Optional[Service] = None,
4243
keep_alive: bool = True,
4344
) -> None:
4445
"""Creates a new instance of the Firefox driver. Starts the service and

py/selenium/webdriver/ie/service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ class Service(service.Service):
2626

2727
def __init__(
2828
self,
29-
executable_path: str = None,
29+
executable_path: Optional[str] = None,
3030
port: int = 0,
3131
host: Optional[str] = None,
3232
service_args: Optional[List[str]] = None,
3333
log_level: Optional[str] = None,
34-
log_output: SubprocessStdAlias = None,
35-
driver_path_env_key: str = None,
34+
log_output: Optional[SubprocessStdAlias] = None,
35+
driver_path_env_key: Optional[str] = None,
3636
**kwargs,
3737
) -> None:
3838
"""Creates a new instance of the Service.

py/selenium/webdriver/ie/webdriver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
from typing import Optional
19+
1820
from selenium.webdriver.common.driver_finder import DriverFinder
1921
from selenium.webdriver.remote.client_config import ClientConfig
2022
from selenium.webdriver.remote.remote_connection import RemoteConnection
@@ -30,8 +32,8 @@ class WebDriver(RemoteWebDriver):
3032

3133
def __init__(
3234
self,
33-
options: Options = None,
34-
service: Service = None,
35+
options: Optional[Options] = None,
36+
service: Optional[Service] = None,
3537
keep_alive: bool = True,
3638
) -> None:
3739
"""Creates a new instance of the Ie driver.

0 commit comments

Comments
 (0)