Return value usage

Zac Burns zac256 at
Wed Apr 29 19:29:08 CEST 2009

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

> 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
Aim - Zac256FL
Production Engineer (Digital Overlord)
Zindagi Games

More information about the Python-list mailing list