Possible Duplicate:
Python: Difference between class and instance attributes
class a:
m = 1
def __init__(self):
self.n = 2
According to the book I am reading, m
is called class attributes and n
is called data attributes, but what's the difference between them?
It seems that the operations of them is nearly same. The only difference I can tell is one is in the function __init__
and another isn't.