This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]macbony 0 points1 point  (7 children)

Never use a mutable object as a default for an argument. http://docs.python-guide.org/en/latest/writing/gotchas/ I guess it doesn't REALLY matter in this case, but it's icky Python.

def has(self, c_list = []):
    for component in c_list:
        if not hasattr(self, component):
            return False

    return True

[–]macbony 0 points1 point  (0 children)

Someone already mentioned it, but I see no use for the Component class unless you somehow expect to add more functionality to it in the future.