Skip to content

Commit

Permalink
remove unnecessary casts
Browse files Browse the repository at this point in the history
  • Loading branch information
srjoglekar246 committed Jan 16, 2025
1 parent 7572964 commit 89c73fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/packages/autogen-core/src/autogen_core/_cache_store.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Dict, Generic, Optional, Protocol, TypeVar, cast
from typing import Dict, Generic, Optional, Protocol, TypeVar

T = TypeVar("T")

Expand Down Expand Up @@ -37,10 +37,10 @@ def set(self, key: str, value: T) -> None:

class InMemoryStore(CacheStore[T]):
def __init__(self) -> None:
self.store: Dict[str, Any] = {}
self.store: Dict[str, T] = {}

def get(self, key: str, default: Optional[T] = None) -> Optional[T]:
return cast(Optional[T], self.store.get(key, default))
return self.store.get(key, default)

def set(self, key: str, value: T) -> None:
self.store[key] = value

0 comments on commit 89c73fe

Please sign in to comment.