From 250fc4d7280485f3a764679363c271ca2173d980 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 22 Jun 2021 04:28:35 +0200 Subject: [PATCH] [mod] add Table.__{g,s}etitem__ for backward compatibility --- moulinette/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/moulinette/__init__.py b/moulinette/__init__.py index e73853f6..c2eb1120 100755 --- a/moulinette/__init__.py +++ b/moulinette/__init__.py @@ -71,6 +71,12 @@ class Table: self.title = title self.row_function = row_function + def __getitem__(self, key): + return self.data[key] + + def __setitem__(self, key, value): + self.data[key] = value + def print(self): if not self.data: return