weakrefs

Martin v. Löwis martin at v.loewis.de
Thu Dec 4 15:40:21 EST 2003


William Trenker <wtrenker at shaw.ca> writes:

> Can anyone point me to tutorials or examples that illustrate where
> and why one would use a proxy instead of a ref?

It's very easy: If you want the weakref to be used transparently in
place of the original object, you use a proxy - it tries to emulate,
by delegation, all attributes to the underlying objects. If you can
accept an explicit dereference operation throughout, you use a ref.

Regards,
Martin





More information about the Python-list mailing list