J
Jayden
Dear All,
In the Python Tutorial, Section 9.4, it is said that
"Data attributes override method attributes with the same name."
But in my testing as follows:
#Begin
class A:
i = 10
def i():
print 'i'
A.i
<unbound method A.i>
#End
I think A.i should be the number 10 but it is the method. There must be something I misunderstand. Would you please tell me why?
Thanks,
Jayden
In the Python Tutorial, Section 9.4, it is said that
"Data attributes override method attributes with the same name."
But in my testing as follows:
#Begin
class A:
i = 10
def i():
print 'i'
A.i
<unbound method A.i>
#End
I think A.i should be the number 10 but it is the method. There must be something I misunderstand. Would you please tell me why?
Thanks,
Jayden