The `greet_outer` is defined outside the class and still can be used as a bound method.
Now the question arises, "Is our explanation given above about `functions and methods` correct completely?"
Let's check what we can add here:
Now the question arises, "Is our explanation given above about `functions and methods` correct completely?"
Let's check what we can add here:
If a function bound to a class is called by an instance of that class and passes that instance, as the first argument to that function, then only that function is called a method of that class instance.
Therefore, function and method are not directly dependent on where they are declared, and a function object can be called a method object by assigning it to a class.
I am still open to the correction of the statement above...
I am still open to the correction of the statement above...
β‘ Thanks for investing your time in this Python Code.
If it helped you, 2 requests:
β Retweet the first tweet so others find it too
β Follow @CodingMantras for more on Python
It encourages me to keep coding and sharing!
If it helped you, 2 requests:
β Retweet the first tweet so others find it too
β Follow @CodingMantras for more on Python
It encourages me to keep coding and sharing!
Loading suggestions...