コード例 #1
0
 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.'
     )
コード例 #2
0
 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
コード例 #3
0
 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
コード例 #4
0
 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'
     )
コード例 #5
0
 class A:
     lone_freezer = FreezerProperty()
コード例 #6
0
 class A(object):
     lone_freezer = FreezerProperty()