Skip to content

Commit

Permalink
v14: Type-hinting: modernize: remove some legacy typing imports
Browse files Browse the repository at this point in the history
Logically re-applies/continues commit 4408721.
  • Loading branch information
jayaddison committed Oct 3, 2024
1 parent 83ab029 commit 1859726
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions recipe_scrapers/_abstract.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import inspect
from collections import OrderedDict
from typing import Dict, Optional, Tuple, Union
from urllib.parse import urljoin

import requests
Expand All @@ -21,19 +20,19 @@


class AbstractScraper:
page_data: Union[str, bytes]
page_data: str | bytes

def __init__(
self,
url: Union[str, None],
proxies: Optional[
Dict[str, str]
] = None, # allows us to specify optional proxy server
timeout: Optional[
Union[float, Tuple[float, float], Tuple[float, None]]
] = None, # allows us to specify optional timeout for request
wild_mode: Optional[bool] = False,
html: Union[str, bytes, None] = None,
url: str | None,
proxies: (
dict[str, str] | None
) = None, # allows us to specify optional proxy server
timeout: (
float | tuple[float, float] | tuple[float, None] | None
) = None, # allows us to specify optional timeout for request
wild_mode: bool | None = False,
html: str | bytes | None = None,
):
if html:
self.page_data = html
Expand Down

0 comments on commit 1859726

Please sign in to comment.