Commit d61c15e8 authored by Martin Glatzle's avatar Martin Glatzle

Fall back to base class when adding size distributions.

parent 14849b00
...@@ -128,11 +128,11 @@ class SizeDist(object): ...@@ -128,11 +128,11 @@ class SizeDist(object):
elif callable(other): elif callable(other):
def func(sizes): def func(sizes):
return self.func(sizes) + other(sizes) return self.func(sizes) + other(sizes)
return self.__class__(self.sizeMin, self.sizeMax, func) return SizeDist(self.sizeMin, self.sizeMax, func)
else: else:
def func(sizes): def func(sizes):
return other + self.func(sizes) return other + self.func(sizes)
return self.__class__(self.sizeMin, self.sizeMax, func) return SizeDist(self.sizeMin, self.sizeMax, func)
# make addition commutative # make addition commutative
__radd__ = __add__ __radd__ = __add__
......
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