def __iadd__(self, other):
        """add other to my value and return self

             >>> c = Counter(100)
             >>> c += 333
             >>> c == 433
             True
        """
        if self.maxval is not None and ((self._count + other) > self.maxval):
            raise ValueError("sorry, counter got too big")
        else:
            self._count += other
        return self
add other to my value and return self

             >>> c = Counter(100)
             >>> c += 333
             >>> c == 433
             True
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/mockdoctest.py