From 89c73fe821ffa342c410a61b2481e2b3fbefd91d Mon Sep 17 00:00:00 2001 From: Sachin Joglekar Date: Thu, 16 Jan 2025 22:19:12 +0000 Subject: [PATCH] remove unnecessary casts --- .../packages/autogen-core/src/autogen_core/_cache_store.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/packages/autogen-core/src/autogen_core/_cache_store.py b/python/packages/autogen-core/src/autogen_core/_cache_store.py index 7f3a12185e6..339048fdc8f 100644 --- a/python/packages/autogen-core/src/autogen_core/_cache_store.py +++ b/python/packages/autogen-core/src/autogen_core/_cache_store.py @@ -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") @@ -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