refactor: removed json typing
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import json as json_module
|
||||
import os
|
||||
from typing import cast
|
||||
import requests
|
||||
|
||||
CACHE_DIR = ".cached"
|
||||
@@ -37,9 +36,6 @@ def text(url: str) -> str:
|
||||
return content
|
||||
|
||||
|
||||
type JVal = dict[str, "JVal"] | list["JVal"] | str | int | float | bool | None
|
||||
|
||||
|
||||
def json(url: str) -> JVal:
|
||||
def json(url: str): # pyright: ignore[reportAny]
|
||||
raw_text = text(url)
|
||||
return cast(JVal, json_module.loads(raw_text))
|
||||
return json_module.loads(raw_text) # pyright: ignore[reportAny]
|
||||
|
||||
Reference in New Issue
Block a user