class A:
name = 10 # this is a class variable
def fun(self):
print('this is a function')
return name # this is the return value, but same 'name'
name = A()
name.fun()
print(name.fun())
# operation result
this is a function
this is a function
<__main__.A object at 0x000001D95A894508>
It can run successfully, but it does not conform to grammatical logic, why does it(the 'name') not report an error?