I hase test class:
class Foo_class:
def __init__(self,x=0):
"""init, x defaul as 0."""
self.x=x
def val(self):
return self.x
I want to understand, how can call:
f=Foo_class()
print(f.val)
That f.val will return value of def f.val().
Is it possible?
propertyf.valwill return the address of that method object in the class as follows,<bound method Foo_class.val of <__main__.Foo_class object at 0x000002A1D9098160>>self.val = xin the__init__... ;)