return value
+ def __delete__(self, obj):
+ try:
+ del obj._cache[self.__name__]
+ except (KeyError, AttributeError):
+ pass
+
# Aliases to make cached_property_with_ttl easier to use
cached_property_ttl = cached_property_with_ttl
timed_cached_property = cached_property_with_ttl
c = Check()
+ # Resetting the cache before it is set is a no-op
+ del c.add_cached
+
# Run standard cache assertion
self.assertEqual(c.add_cached, 1)
self.assertEqual(c.add_cached, 1)
# Reset the cache.
- del c._cache['add_cached']
+ del c.add_cached
self.assertEqual(c.add_cached, 2)
self.assertEqual(c.add_cached, 2)
c = Check()
+ # Resetting the cache before it is set is a no-op
+ del c.add_cached
+
# Run standard cache assertion
self.assertEqual(c.add_cached, 1)
self.assertEqual(c.add_cached, 1)
# Reset the cache.
- del c._cache['add_cached']
+ del c.add_cached
self.assertEqual(c.add_cached, 2)
self.assertEqual(c.add_cached, 2)