added detailed dict types
This commit is contained in:
1 parent
87bfd76ba7
commit
29f79c881a
1 file changed
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
|
|
||||||
def parse_style(style: str) -> dict:
|
def parse_style(style: str) -> dict[str, str]:
|
||||||
result = {}
|
result: dict[str, str] = {}
|
||||||
key_buffer = ""
|
key_buffer = ""
|
||||||
buffer = ""
|
buffer = ""
|
||||||
for char in style:
|
for char in style:
|
||||||
@@ -20,7 +20,7 @@ def parse_style(style: str) -> dict:
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def style_to_string(style: dict) -> str:
|
def style_to_string(style: dict[str, str]) -> str:
|
||||||
return ";".join([f"{name}:{value}" for name, value in style.items()])
|
return ";".join([f"{name}:{value}" for name, value in style.items()])
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user