better type hinting

This commit is contained in:
Jörn-Michael Miehe 2022-03-30 11:15:38 +00:00
parent e1ae186382
commit 24721dd342

View file

@ -37,11 +37,19 @@ class Settings(BaseSettings):
redoc_url: str | None = "/redoc" redoc_url: str | None = "/redoc"
@classmethod @classmethod
@property
@functools.lru_cache @functools.lru_cache
def _(cls) -> Settings: def load(cls) -> Settings:
return cls() return cls()
@classmethod
@property
def _(cls) -> Settings:
"""
Shorthand for load()
"""
return cls.load()
@property @property
def config_file(self) -> Path: def config_file(self) -> Path:
return self.data_dir.joinpath(self.config_file_name) return self.data_dir.joinpath(self.config_file_name)