Skip to content

Commit

Permalink
Add cast for type assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Apr 8, 2024
1 parent f1e40e5 commit 72e4138
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions yellowstone/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

import logging
from typing import Any
from typing import Any, cast
from xmlrpc.client import ServerProxy

from .config import getenv
Expand All @@ -24,9 +24,10 @@ def __init__(self, username=None, api_key=None):
)

def posts_get(self, *, site: str, posts: list[str]) -> dict[str, dict[str, Any]]:
return self.proxy.posts.get(
data = self.proxy.posts.get(
{
"site": site,
"posts": posts,
}
)
return cast(dict[str, dict[str, Any]], data)

0 comments on commit 72e4138

Please sign in to comment.