Skip to content

Can I stash instances of things and expect it to work? #5187

Answered by willmcgugan
DanCardin asked this question in Q&A
Discussion options

You must be logged in to vote

If you recompose, the current widgets will be removed, including any attribute you have stored. Adding a widget after it has been removed, will break unfortunately.

query_one should never return None, so no assert should be required.

query_one is generally fast enough for it to not be a concern, however you could use get_child_by_id for the fastest lookup.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DanCardin
Comment options

@willmcgugan
Comment options

Answer selected by DanCardin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants