Cristiano Paris wrote:
> I'm trying to write a Container which should mimic a list. Basically,
> the container pulls items on the fly from an unspecified source through
> a function and returns an instance of a given class over the pulled item.
>
> That is:
>
> class lazy(object):
>def __get
Duncan Booth wrote:
> ...
> Yes. Try using weak references. Specifically a weakref.WeakValueDictionary
> should meet your needs.
:D
Thank you.
Cristiano
--
http://mail.python.org/mailman/listinfo/python-list
Cristiano Paris <[EMAIL PROTECTED]> wrote:
> May be someone has faced this problem before and came up with some
> obscure language feature to solve this elegantly :D
Yes. Try using weak references. Specifically a weakref.WeakValueDictionary
should meet your needs.
--
http://mail.python.org/mai
Hi everyone,
I'm trying to write a Container which should mimic a list. Basically,
the container pulls items on the fly from an unspecified source through
a function and returns an instance of a given class over the pulled item.
That is:
class lazy(object):
def __getitem__(self,index):