From 26382f087000291ce781a0bb213259806337cc96 Mon Sep 17 00:00:00 2001 From: Amogh Mannekote Date: Fri, 19 Jul 2019 19:51:49 +0200 Subject: [PATCH] Delegate missing attributes to original dataset object --- nonechucks/dataset.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nonechucks/dataset.py b/nonechucks/dataset.py index 5dd8d72..825c937 100644 --- a/nonechucks/dataset.py +++ b/nonechucks/dataset.py @@ -92,3 +92,9 @@ def __getitem__(self, idx): return sample idx += 1 raise IndexError + + def __getattr__(self, key): + """Delegates to original dataset object if an attribute is not + found in this class. + """ + return getattr(self.dataset, key)