If I have a class
class Kid():
def __init(name):
self.name = name
what should I add to it to be able to do this:
def is_cool(kid):
cool_kids = {"Jim","Bill","Nebuchadnezzar II"}
return kid in cool_kids
Do I have to inherit Kid from str?
ADD 1: I know I can write return kid.name in cool_kids
, but I am looking for a little syntax sugar for my code. I want a way to check for obj in set of very different objects.