I'm really surprised at the amount of anthropomorphizing of animals in this thread.
FWIW, even dogs don't think in terms of "revenge" or "getting back" at someone. That's a human concept. Dogs do what has worked for them in the past. If you have a dog that learns it can guard one particular person from other people by snarling, snapping, biting, it will continue to do so because it can. It's not "being mean". It's being a dog.
And, no offence to snakes, but if dogs don't think in terms of vengeance or being mean, snakes certainly don't.