Python: How Instance and Class Attributes Work