Commit 3b671f3e authored by Mathieu Giraud's avatar Mathieu Giraud Window.__iadd__, aggregating windows without extending lists.

Window.__add__ extends the lists, it is not wanted when one simply wants to combine windows.
This .__iadd__ method is actually dead code, but the method is nice.
parent 92519fc9
......@@ -65,7 +65,19 @@ class Window:
def __iadd__(self, other):
### Not used now
"""Add other.size to self.size in-place, without extending lists"""
assert(len(self.d['size']) == len(other.d['size']))
self.d['size'] = [my + her for (my, her) in zip(self.d['size'], other.d['size'])]
return self
def __add__(self, other):
"""Concat two windows, extending lists such as 'size'"""
#data we don't need to duplicate
myList = [ "V", "D", "J", "Vend", "Dend", "Jstart", "Dstart", "top", "window", "Nlength", "sequence", "name", "id", "status"]
obj = Window(1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment