From 1343265f61d3c3e558669ef2c5d1268328626371 Mon Sep 17 00:00:00 2001 From: Jameson Graef Rollins <jameson.rollins@ligo.org> Date: Fri, 9 Oct 2020 14:37:10 -0700 Subject: [PATCH] struct: don't include '_' prefixed attributes in dict representation those variables will be considered internal. --- gwinc/struct.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gwinc/struct.py b/gwinc/struct.py index b11d017b..2de5efef 100644 --- a/gwinc/struct.py +++ b/gwinc/struct.py @@ -173,7 +173,9 @@ class Struct(object): """ d = {} - for k,v in self.__dict__.items(): + for k, v in self.__dict__.items(): + if k[0] == '_': + continue if isinstance(v, Struct): d[k] = v.to_dict(array=array) else: -- GitLab