40 | | class CachedProperty(CachedPropertyBase): |
41 | | """Cached property descriptor for classes having potentially |
42 | | @@ -111,6 +116,9 @@ class CachedProperty(CachedPropertyBase): |
43 | | setattr(instance, self.key_attr, id) |
44 | | CacheManager(instance.env).invalidate(id) |
| 40 | class CachedSingletonProperty(CachedPropertyBase): |
| 41 | """Cached property descriptor for classes behaving as singletons |
| 42 | }}} |
46 | | + def __set__(self, instance, value): |
47 | | + raise AttributeError('Setting attribute is not allowed.') |
48 | | + |
49 | | |
50 | | def cached(fn_or_attr=None): |
51 | | """Method decorator creating a cached attribute from a data |
52 | | diff --git a/trac/util/__init__.py b/trac/util/__init__.py |
53 | | index c0b81c2..1612a85 100644 |
54 | | --- a/trac/util/__init__.py |
55 | | +++ b/trac/util/__init__.py |
56 | | @@ -1114,6 +1114,9 @@ class lazy(object): |
57 | | setattr(instance, self.fn.__name__, result) |
58 | | return result |
59 | | |
60 | | + def __set__(self, instance, value): |
61 | | + raise AttributeError('Setting attribute is not allowed.') |
62 | | + |
63 | | |
64 | | # -- algorithmic utilities |
65 | | |
66 | | }}} |
| 44 | Edit: removed `__set__` from `lazy` class in the patch. Cannot create `TicketSystem` instance with `__set__`. |