Hello I have a simple problem but very problematic.
I got a class, and in the attributes i got something like that:
self.List = [ obj_0, obj_1, … ]
the objects inside List are instances that have an attribute called “is_active”, and its value can only be “True” or “False”.
I extract the elements from self.List, to build a new one with only active objects
self.active_objects = [ ele for ele in self.List if ele.is_active == True ]
The result gives 2 elements while there whould be 4
when I make the second list outsine the console, it works well.
Can Someone explain me why is this occuring ? And how can I solve this problem ?