class E: different_type_freeze_counter = caching.CachedProperty(0) different_type_thaw_counter = caching.CachedProperty(0) different_type_freezer = FreezerProperty( freezer_type=CustomFreezer, doc='A freezer using a custom freezer class.' )
class D: mix_freeze_counter = caching.CachedProperty(0) mix_thaw_counter = caching.CachedProperty(0) def increment_mix_freeze_counter(self): self.mix_freeze_counter += 1 mix_freezer = FreezerProperty(on_freeze=increment_mix_freeze_counter) @mix_freezer.on_thaw def increment_mix_thaw_counter(self): self.mix_thaw_counter += 1
class C: decorate_happy_freeze_counter = caching.CachedProperty(0) decorate_happy_thaw_counter = caching.CachedProperty(0) decorate_happy_freezer = FreezerProperty() @decorate_happy_freezer.on_freeze def increment_decorate_happy_freeze_counter(self): self.decorate_happy_freeze_counter += 1 @decorate_happy_freezer.on_thaw def increment_decorate_happy_thaw_counter(self): self.decorate_happy_thaw_counter += 1
class C: argument_happy_freeze_counter = caching.CachedProperty(0) argument_happy_thaw_counter = caching.CachedProperty(0) def increment_argument_happy_freeze_counter(self): self.argument_happy_freeze_counter += 1 def increment_argument_happy_thaw_counter(self): self.argument_happy_thaw_counter += 1 argument_happy_freezer = FreezerProperty( on_freeze=increment_argument_happy_freeze_counter, on_thaw=increment_argument_happy_thaw_counter, name='argument_happy_freezer' )
class A: lone_freezer = FreezerProperty()
class A(object): lone_freezer = FreezerProperty()