proxy object

François Pinard pinard at iro.umontreal.ca
Thu Nov 14 17:44:08 EST 2002


[Mike Warren]

> I have a simplified example of what I want to do (which isn't working),
> which basically boils down to this: I want to return a ``proxy'' object
> which delays the instantiation of expensive-to-instantiated objects,
> but I want the object to -- after the instantiation -- behave just like
> it would without the proxy.

Hello, Mike.  Would not it be nicer to merely create the final object
immediately, while implementing some kind of lazy initialisation?  I do
this in many projects: it works just as expected, clean and simple.

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard




More information about the Python-list mailing list