equal
deleted
inserted
replaced
66 # return it |
66 # return it |
67 return value |
67 return value |
68 |
68 |
69 class LazyIteratorProperty (LazyProperty) : |
69 class LazyIteratorProperty (LazyProperty) : |
70 """ |
70 """ |
71 A lazy-loaded property that automatically converts an iterator/genexp into a list. |
71 A lazy-loaded property that automatically converts an iterator/genexp into a non-mutable tuple. |
72 """ |
72 """ |
73 |
73 |
74 def run (self, obj) : |
74 def run (self, obj) : |
75 """ |
75 return tuple(self.func(obj)) |
76 Wrap LazyProperty.run to return a list |
|
77 """ |
|
78 |
|
79 return list(self.func(obj)) |
|
80 |
76 |
81 lazy_load = LazyProperty |
77 lazy_load = LazyProperty |
82 lazy_load_iter = LazyIteratorProperty |
78 lazy_load_iter = LazyIteratorProperty |
83 |
79 |
84 # testing |
80 # testing |