I'm not sure if this is possible, but if anyone has any workarounds, that would be great.
If have a class like so:
class person:
def __init__(self, name):
self.name = name
And I add a bunch of instances of this class to a list, like so:
people = [person("Bob"), person("Tim"), person("Sue")]
I would, in a perfect world like to then perform this code:
people.remove(person("Bob"))
However, unfortunately, due to the way classes work, this is not possible. Is there some sort of workaround for this? Preferably something that fits onto one line?
Any ideas welcome!