Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Children order #204

Open
aerospeace opened this issue Jul 26, 2022 · 2 comments
Open

Children order #204

aerospeace opened this issue Jul 26, 2022 · 2 comments
Milestone

Comments

@aerospeace
Copy link

The current implementation does not provide the ability to rearrange the order of the children, which is used for instance in traversing the tree. I have not found a proper way to reorder children, without detaching and reattaching nodes, which causes all the __detach and __attach to be trigerred.

Would it be possible to improve the implementation to be able to work on the children list without triggering detach and attach, as long as the set(children) stay stable?

Things I would like to be able for instance includes: node.children = sorted(node.children, lambda node: node.weight), or alternatively sort(node.children).

@djakschik
Copy link

Yes it is possible. I need to adapt the implementation. Not triggering the detach and attach hookups on a pure order change, is some kind of API change. Will think about it, but is not a big deal.

@c0fec0de c0fec0de added this to the 3.0.0 milestone Sep 20, 2022
@kayjan
Copy link

kayjan commented Nov 12, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants