Skip to content

Commit ef60b07

Browse files
timmartin19pfifer
authored andcommitted
Make Record Subscriptable (#39)
Previously the `record` that was passed was subscriptable as it was a simple dictionary. This mechanism means that I am still able to do `record['data']` thereby maintaining backwards compatibility.
1 parent 98f92ad commit ef60b07

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

amazon_kclpy/messages.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,4 +368,7 @@ def data(self):
368368

369369
def get(self, field):
370370
return self._json_dict[field]
371+
372+
def __getitem__(self, field):
373+
return self.get(field)
371374

0 commit comments

Comments
 (0)