no need to use self.__dict__
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 11 Apr 2019 15:57:42 +0000 (16:57 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 11 Apr 2019 15:57:42 +0000 (16:57 +0100)
src/add/singlepipe.py

index ff402c605bfff9982861afbfde86e4f8eb6ee4fb..e8d16ef521c1104660d0f8b7d0c9a3de43230030 100644 (file)
@@ -181,12 +181,12 @@ class RecordObject(Record):
     def __setattr__(self, k, v):
         if k in dir(Record) or "fields" not in self.__dict__:
             return object.__setattr__(self, k, v)
-        self.__dict__["fields"][k] = v
+        self.fields[k] = v
         if isinstance(v, Record):
             newlayout = {k: (k, v.layout)}
         else:
             newlayout = {k: (k, v.shape())}
-        self.__dict__["layout"].fields.update(newlayout)
+        self.layout.fields.update(newlayout)