Method or function?

Fredrik Lundh fredrik at effbot.org
Wed Nov 1 18:57:42 CET 2000


Dale Strickland-Clark wrote:
> I can't believe that this hasn't already been discussed in depth
> elsewhere

did you check the FAQ?

    http://www.python.org/doc/FAQ.html#6.5
    "Why does Python use methods for some functionality
    (e.g. list.index()) but functions for other (e.g. len(list))?"

> but, when I get time, I might post a more detailed argument.

people have done that before (why do you think it's
a FAQ?) -- usually people who haven't yet realized that
Python's standard type families are based on informal
interfaces, not subtypes.

(once you understand the difference, it's obvious that
we need more generic functions, not more methods ;-).

</F>





More information about the Python-list mailing list