__add__ was written to try to make _DDB more user friendly. When it was written, the DDB abstraction around _DDB didn't yet exist (to put it another way, what is now _DDB was once called DDB), so at the time, it made (some) sense to try and make things friendly with the + operator. Since _DDB is no longer meant to be used directly, we can change this kludgy code to a traditional function call instead.
Code refs:
-
|
def __add__(self, user_data): |
|
now = time() |
|
while now in self: |
|
sleep(0.1) |
|
now = time() |
|
self[now] = user_data |
|
self._cleanup() |
|
return self |