We have some objects with properties
class my_object: def __init__(self, type, name): self.type = type self.name = name And a list which contains many object with different type and name values.
What I need is a comprehension which does something like:
if my_object.type == 'type 1' in object_list: object_list.remove(all objects with name == 'some_name')