A transform with an internal state. The state is changing at each call.
| 107 | |
| 108 | |
| 109 | class _StatefulTransform(Transform, ThreadUnsafe): |
| 110 | """ |
| 111 | A transform with an internal state. |
| 112 | The state is changing at each call. |
| 113 | """ |
| 114 | |
| 115 | def __init__(self): |
| 116 | self.property = 1 |
| 117 | |
| 118 | def __call__(self, data): |
| 119 | self.property = self.property + 1 |
| 120 | return data * 100 + self.property |
| 121 | |
| 122 | |
| 123 | class TestCacheThread(unittest.TestCase): |
no outgoing calls
searching dependent graphs…