예제 #1
0
    class A:
        reentrant_context_manager = CachedProperty(
            lambda self: get_depth_counting_context_manager())

        @reentrant_context_manager
        def my_method(self, x, y=3):
            return (x, y, self.reentrant_context_manager.depth)
예제 #2
0
    class A:
        reentrant_context_manager = CachedProperty(
            lambda self: context_management.ReentrantContextManager())

        @reentrant_context_manager
        def my_method(self, x, y=3):
            return (x, y, self.reentrant_context_manager.depth)
예제 #3
0
 class A:
     personality = CachedProperty(counting_func, name='meow')
예제 #4
0
 class B:
     brrr_property = CachedProperty('brrr')
예제 #5
0
 class A:
     personality = CachedProperty(counting_func)
예제 #6
0
 class A:
     personality = CachedProperty(counting_func,
                                  force_value_not_getter=True)
예제 #7
0
 class C:
     undocced_property = CachedProperty(lambda self: 1 / 0, )
예제 #8
0
 class B:
     personality = CachedProperty(counting_func, doc='''Ooga booga.''')
예제 #9
0
 class A(object):
     personality = CachedProperty(counting_func, name='personality')
예제 #10
0
 class B(object):
     brrr_property = CachedProperty('brrr')
예제 #11
0
 class C(object):
     undocced_property = CachedProperty(lambda self: 1 / 0, )