diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-14 13:50:57 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-14 13:50:57 +1200 |
commit | d739882bf2dc65925c001c5bf848f5664640d299 (patch) | |
tree | 16383eb21ac6192b29735e6ae899b796a3e085bd /netlib/odict.py | |
parent | 6db5e0a4a133e6e6150f9cab87cd56b40d6db0b2 (diff) | |
download | mitmproxy-d739882bf2dc65925c001c5bf848f5664640d299.tar.gz mitmproxy-d739882bf2dc65925c001c5bf848f5664640d299.tar.bz2 mitmproxy-d739882bf2dc65925c001c5bf848f5664640d299.zip |
Add an .extend method for ODicts
Diffstat (limited to 'netlib/odict.py')
-rw-r--r-- | netlib/odict.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/netlib/odict.py b/netlib/odict.py index 7a2f611b..7a54f282 100644 --- a/netlib/odict.py +++ b/netlib/odict.py @@ -108,6 +108,12 @@ class ODict(object): lst = copy.deepcopy(self.lst) return self.__class__(lst) + def extend(self, other): + """ + Add the contents of other, preserving any duplicates. + """ + self.lst.extend(other.lst) + def __repr__(self): elements = [] for itm in self.lst: |