refactor: pressure_to_mmhg заменяет Any на float | int | str | None
This commit is contained in:
parent
d94b9c16ab
commit
6b0a6cd8a6
@ -1,6 +1,6 @@
|
||||
import asyncio
|
||||
import logging
|
||||
from typing import Any, Optional
|
||||
from typing import Optional
|
||||
|
||||
import requests
|
||||
from requests.exceptions import ConnectionError, Timeout, SSLError
|
||||
@ -241,7 +241,7 @@ def format_weather_for_message(data: Optional[dict]) -> Optional[str]:
|
||||
return "Погода в Магнитогорске:\n" + "\n".join(lines)
|
||||
|
||||
|
||||
def pressure_to_mmhg(mb: Any) -> float | str:
|
||||
def pressure_to_mmhg(mb: float | int | str | None) -> float | str:
|
||||
if mb == "—" or mb is None or mb == "":
|
||||
return "—"
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user