Skip to content

Commit 9ee8739

Browse files
author
marwan37
committed
properly declare wrapper cache type annotation in __init__ method
1 parent 188a659 commit 9ee8739

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

bundled/tool/lsp_zenml.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def __init__(self, *args, **kwargs):
4242
super().__init__(*args, **kwargs)
4343
self.python_interpreter = sys.executable
4444
self.zenml_client = None
45+
self._wrapper_cache: Dict[str, Any] = {}
4546
# self.register_commands()
4647

4748
async def is_zenml_installed(self) -> bool:
@@ -135,9 +136,6 @@ def wrapper(*args, **kwargs):
135136

136137
# Cache wrapper instances to avoid repeated getattr calls
137138
if wrapper_name:
138-
if not hasattr(self, "_wrapper_cache"):
139-
self._wrapper_cache: Dict[str, Any] = {}
140-
141139
if wrapper_name not in self._wrapper_cache:
142140
wrapper_instance = getattr(self.zenml_client, wrapper_name, None)
143141
if not wrapper_instance:

0 commit comments

Comments
 (0)