Mercurial > python-cmd2
changeset 323:fc1e5a141920
tweak to settable
author | catherine@dellzilla |
---|---|
date | Thu, 11 Feb 2010 14:46:50 -0500 |
parents | 7cd74e42b7f9 |
children | 21584174d865 |
files | cmd2.py |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/cmd2.py Thu Feb 11 14:41:07 2010 -0500 +++ b/cmd2.py Thu Feb 11 14:46:50 2010 -0500 @@ -37,6 +37,7 @@ import glob import traceback import platform +import copy from code import InteractiveConsole, InteractiveInterpreter, softspace from optparse import make_option @@ -291,6 +292,14 @@ def __iadd__(self, arg): self.update(arg) return self + def __add__(self, arg): + selfcopy = copy.copy(self) + selfcopy.update(stubbornDict(arg)) + return selfcopy + def __radd__(self, arg): + selfcopy = copy.copy(self) + selfcopy.update(stubbornDict(arg)) + return selfcopy @classmethod def to_dict(cls, arg):