Python Forum

Full Version: Bound method
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, i'm new to python and i have a quesition about method:

When i try this:

class Test:
    def test1():
        pass
a=Test()
print(Test.test1)
print(a.test1)
It printed out:
<function Test.test1 at 0x7fba4f2646a8>
<bound method Test.test1 of <__main__.Test object at 0x7fba510ee8d0>>
What is the differences between function and bound method ?
Uchikago Wrote:What is the differences between function and bound method
Conceptually, a bound method is a pair consisting of a class instance and a function. It is wrapped as a callable python object.