From f5041df3d60f1b0593d1fe85c07a9a82d098b5b2 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 26 Oct 2007 00:18:37 -0400 Subject: [PATCH] Add non-in-place extend() to ArithmeticList() --- src/arithmetic_container.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/arithmetic_container.py b/src/arithmetic_container.py index 19b0872..23845ca 100644 --- a/src/arithmetic_container.py +++ b/src/arithmetic_container.py @@ -131,6 +131,16 @@ class ArithmeticList(list): def __repr__(self): return "ArithmeticList(%s)" % list.__repr__(self) + def plus(self, other): + """Return a copy of self extended by the entries from the iterable + C{other}. + + Makes up for the loss of the C{+} operator (which is now arithmetic). + """ + result = ArithmeticList(self) + result.extend(other) + return result + -- GitLab