Skip to content

Commit

Permalink
add default param for datacontainer get function
Browse files Browse the repository at this point in the history
the usage pattern looks like one should be able to do this which would come in handy
  • Loading branch information
maurerle committed Oct 22, 2024
1 parent 500c4d7 commit 3a91044
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mango/agent/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ def __setitem__(self, key, newvalue):
def __contains__(self, key):
return hasattr(self, key)

def get(self, key):
def get(self, key, default=None):
if key in self:
return self[key]
else:
return None
return default

def update(self, data: dict):
for k, v in data.items():
Expand Down

0 comments on commit 3a91044

Please sign in to comment.