我是Python的新手,我使用的是Python 3.3.1.
class Parent: # define parent class
parentAttr = 100
age = 55
def __init__(self):
print ("Calling parent constructor")
def setAttr(self, attr):
Parent.parentAttr = attr
class Child(Parent):
def childMethod(self):
print ('Calling child method')
Run Code Online (Sandbox Code Playgroud)
现在我要创造
c=child
c.[here every thing will appear methods and attr (age,setAttr)]
Run Code Online (Sandbox Code Playgroud)
我怎样才能区分方法和属性?我的意思是,我什么时候使用c.SetAtrr(Argument), c.SetAtrr=value?