style: A lot of type hints correction
Since we are using Py3.10 as minimum version now, we remove Union when possible
This commit is contained in:
@@ -11,7 +11,7 @@ from msgspec import Struct, structs, convert, ValidationError
|
||||
from playwright.sync_api import Route
|
||||
|
||||
from scrapling.core.utils import log
|
||||
from scrapling.core._types import Dict, Optional, Union, Tuple
|
||||
from scrapling.core._types import Dict, Optional, Tuple
|
||||
from scrapling.engines.constants import DEFAULT_DISABLED_RESOURCES
|
||||
|
||||
__BYPASSES_DIR__ = Path(__file__).parent / "bypasses"
|
||||
@@ -54,8 +54,8 @@ async def async_intercept_route(route: async_Route):
|
||||
|
||||
|
||||
def construct_proxy_dict(
|
||||
proxy_string: Union[str, Dict[str, str]], as_tuple=False
|
||||
) -> Union[Dict, Tuple, None]:
|
||||
proxy_string: str | Dict[str, str], as_tuple=False
|
||||
) -> Optional[Dict | Tuple]:
|
||||
"""Validate a proxy and return it in the acceptable format for Playwright
|
||||
Reference: https://playwright.dev/python/docs/network#http-proxy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user