functions vs methods

dieter dieter at handshake.de
Sun Jul 22 00:52:46 EDT 2018


Sharan Basappa <sharan.basappa at gmail.com> writes:

> Is there a difference between functions and methods in Python.

Somewhat simplified: a method is a function with the
method's associated object implicitly passed as first argument.

For a Python defined method "m", you can get the corresponding
function via "m.__func__" (this is not necessarily true
for methods defined in "C", among them built-in methods).




More information about the Python-list mailing list