[+] improve typing
This commit is contained in:
parent
2dec1e33c2
commit
4440e084b9
17
deps/test-task-2025-06-30-v1/python/online/fxreader/pr34/test_task_2025_06_30_v1/tickers/settings.py
vendored
Normal file
17
deps/test-task-2025-06-30-v1/python/online/fxreader/pr34/test_task_2025_06_30_v1/tickers/settings.py
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import pydantic
|
||||
import pydantic_settings
|
||||
|
||||
from typing import (ClassVar, Optional,)
|
||||
|
||||
|
||||
class Settings(pydantic_settings.BaseSettings):
|
||||
db_url : str
|
||||
|
||||
_singleton : ClassVar[Optional['Settings']] = None
|
||||
|
||||
@classmethod
|
||||
def singleton(cls) -> 'Settings':
|
||||
if cls._singleton is None:
|
||||
cls._singleton = Settings.model_validate({})
|
||||
|
||||
return cls._singleton
|
Loading…
Reference in New Issue
Block a user