Is it possible to implement some sort of "lazy" creation of objects only when the object is used, but behaving in the same way as the object? For instance: class Foo: def __init__(self, val): """This is really slow.""" self.num = val # this doesn't call Foo.__init__ yet a = lazyclass(Foo, 6) # Foo is only initalised here print a.num What I really want to do is make an object which looks like a numarray, but only computes its contents the first time it is used. Thanks Jeremy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4