Return value usage

Zac Burns zac256 at gmail.com
Wed Apr 29 13:29:08 EDT 2009


On Wed, Apr 29, 2009 at 10:14 AM, Simon Brunning
<simon at brunningonline.net> wrote:
> 2009/4/29 Zac Burns <zac256 at gmail.com>:

> Why not return a proxy, and have the proxy do the retrieval of the
> needed data if it's used? Delegation is ridiculously easy in Python.

Interesting idea. I like it.

I've looked through some recipes here, but everything I've looked at
has limitations regarding magic methods and such. Several of the
workarounds involve creating a new subclass on the fly, but without
reading the pickle file to know the type of the return value that
would not be possible.

How would you suggest implementing the delegation? Do you know of a
particularly useful recipe?

--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games



More information about the Python-list mailing list