It makes a copy of the list of components (shallowcopy), not a
deepcopy. that means that it returns a new list but the objects in
there should still be references to the original helpers and you can
modify them. Does this cause unexpected behaviour? If so can you post
an example? Perhaps we can improve it.

On May 19, 1:38 pm, Ian Reinhart Geiser <ian.gei...@gmail.com> wrote:
> Greetings, is there a technical reason why DIV.elements makes a copy
> of the elements that it returns?  The reason I am asking is because I
> am making a minor change to it to allow it to call children's
> elements() method.  This way I can overload the elements() method in
> those children.  The reason I am doing this is I have some SCRIPT()
> objects that are being created in the children but only after all of
> their children have been added.  Then I am using
> DIV.elements('script') to extract all of these individual scripts and
> place them as a preceding sibling SCRIPT object to the top level DIV.
> At any rate, I just want to make sure that there is a good reason that
> a copy is being performed so I can preserve that when I finish the
> refactoring.
>
> As a side note, from what I can tell is DIV.siblings is the same
> story, but it doesn't make a copy of the elements it returns.

Reply via email to