diff options
Diffstat (limited to 'tutorius/properties.py')
-rw-r--r-- | tutorius/properties.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tutorius/properties.py b/tutorius/properties.py index a675ba9..427222b 100644 --- a/tutorius/properties.py +++ b/tutorius/properties.py @@ -19,7 +19,7 @@ TutoriusProperties have the same behaviour as python properties (assuming you also use the TPropContainer), with the added benefit of having builtin dialog prompts and constraint validation. """ -from copy import copy +from copy import copy, deepcopy from .constraints import Constraint, \ UpperLimitConstraint, LowerLimitConstraint, \ @@ -93,8 +93,16 @@ class TPropContainer(object): """ Return the list of property names. """ + # Why isn't it simply: + # return self._props.keys() ? return object.__getattribute__(self, "_props").keys() + def get_properties_dict_copy(self): + """ + Return a deep copy of the dictionary of properties from that object. + """ + return deepcopy(self._props) + # Providing the hash methods necessary to use TPropContainers # in a dictionary, according to their properties def __hash__(self): |