Skip to content

Commit 6ce10d2

Browse files
committed
Added __eq__ function to DictWrapper for better eqaulity checks
1 parent 2c03d54 commit 6ce10d2

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):
14+
if not isinstance(other, DictWrapper):
15+
return NotImplemented
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)