Skip to content

Commit bf4ef14

Browse files
authored
Merge pull request aws-powertools#233 from GroovyDan/improv/add_equality_check_to_dict_wrapper
improv: Added __eq__ function to DictWrapper for better equality checks
2 parents 2c03d54 + 98781e1 commit bf4ef14

File tree

1 file changed

+6
-0
lines changed
  • aws_lambda_powertools/utilities/data_classes

1 file changed

+6
-0
lines changed

aws_lambda_powertools/utilities/data_classes/common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ def __init__(self, data: Dict[str, Any]):
1010
def __getitem__(self, key: str) -> Any:
1111
return self._data[key]
1212

13+
def __eq__(self, other: Any) -> bool:
14+
if not isinstance(other, DictWrapper):
15+
return False
16+
17+
return self._data == other._data
18+
1319
def get(self, key: str) -> Optional[Any]:
1420
return self._data.get(key)
1521

0 commit comments

Comments
 (0)