This commit is contained in:
Diogo Sousa
2023-07-31 19:58:48 +01:00
parent 74d8e33b8f
commit 049366567d
2 changed files with 6 additions and 3 deletions

View File

@@ -1,6 +1,9 @@
from typing import Dict
class SingletonMeta(type):
# TODO : check if we want to update this to be thread safe
_instances = {}
_instances: Dict[object, object] = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:

View File

@@ -1,6 +1,6 @@
"""Abstract class for providers."""
from typing import Dict, List, Optional
from typing import Dict, List, Optional, Type
from openbb_provider.abstract.fetcher import Fetcher
@@ -13,7 +13,7 @@ class Provider:
name: str,
description: str,
required_credentials: Optional[List[str]],
fetcher_dict: Dict[str, Fetcher],
fetcher_dict: Dict[str, Type[Fetcher]],
) -> None:
"""Initialize the provider."""
self.name = name