Skip to content

Commit

Permalink
Fix setattr bug, attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
pnsaevik committed Sep 17, 2024
1 parent 40f687b commit 5d2584e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ladim/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ def __getattr__(self, item):
return self[item]

def __setattr__(self, item, value):
# Only allow setting of predefined attributes
if item in self.__dict__:
if item in list(self.__dict__.keys()) + ['_data', '_model', '_num_released', '_varnames']:
super().__setattr__(item, value)
elif item in self._data:
self._data[item] = value
Expand Down

0 comments on commit 5d2584e

Please sign in to comment.