In its essence, I do this:
a = True
b = False
ls = [a, b]
a = False
print(ls)
> [True, False]
And what happens is that whatever happens to a
is decoupled from the list after the first inclusion. Is there any way to update a
and also have the list updating itself, in a clean way?
Of course I could simply do ls[0] = False
and be done. But in a large project, with many moving parts, I'd like to avoid non-descriptive bracket indexing.
I assume I could do some messy construct of an instantiated class, and then iterate over the attributes, but that sounds like messy business. Or is it?