difference between an object property and type property
Some one to help me this, What is the difference between an object pr开发者_Go百科operty and type property? if possible with an example in python.. thanks!
class A:
class_property = 10
def __init__(self):
self.object_property = 20
The difference is that you can access class_property through class A:
print A.class_property
but you can access object_property only through an instance of A:
a = A()
print a.object_property
精彩评论