Skip to content

Commit

Permalink
Type getitem methods in RecursiveDict
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Nov 10, 2023
1 parent dc8a42a commit d7167b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sdsstools/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ def __init__(self, value: dict[str, Any] = {}, strict_mode: bool = False):

dict.__init__(self, value)

def __getitem__(self, __key: str):
def __getitem__(self, __key: str) -> Any:
if self.strict_mode:
return super().__getitem__(__key)

return self.get(__key)

def get(self, __key: str, default: Any = None, strict: bool | None = None):
def get(self, __key: str, default: Any = None, strict: bool | None = None) -> Any:
if (strict is None and self.strict_mode is True) or strict is True:
return super().get(__key, default)

Expand Down

0 comments on commit d7167b1

Please sign in to comment.