cloudant-labs/cloudant-python

Document.__del__ called when object garbage collected, not just when `del doc`

nirvinehh opened this issue · 2 comments

I think this method should be __delitem__(_id) on Database. __del__ gets called on garbage collection:

>>> class Foo(object):
...     def __del__(self):
...         print '__del__'
...
>>> def make_foo():
...     f = Foo()
...
>>> make_foo()
__del__

The tests pass because __del__ represses exceptions.

Oh jeez, good point. Will fix.

Fixed here: 0460966

Thanks for raising the issue!