self-aware list of objects able to sense constituent member alterations?

Chris Rebert clp2 at rebertia.com
Tue Jan 27 16:27:02 EST 2009


On Tue, Jan 27, 2009 at 1:16 PM, Reckoner <reckoner at gmail.com> wrote:
> I'm not sure this is possible, but I would like to have
> a list of  objects
>
> A=[a,b,c,d,...,z]
>
> where,  in the midst of a lot of processing I might do something like,
>
> A[0].do_something_which_changes_the_properties()
>
> which alter the properties of the object 'a'.
>
> The trick is that I would like A to be mysteriously aware that
> something about the  object 'a' has changed so that when I revisit A,
> I will know that the other items in the list need to be refreshed to
> reflect the changes in A as a result of changing 'a'.

Have you considered:

A.change_properties_of_item_and_know_about_it(0)

?

Cheers,
Chris

-- 
Follow the path of the Iguana...
http://rebertia.com



More information about the Python-list mailing list