I want the class to do the same as the following:
class Player:
def __init__(self, **kwargs):
try:
self.last_name = kwargs['last_name']
except:
pass
try:
self.first_name = kwargs['first_name']
except:
pass
try:
self.score = kwargs['score']
except:
pass
But this looks really sloppy to me. Is there a better way to define this __init__ method? I would like all of the keyword arguments to remain optional.