Python Polymorphism

Fredrik Lundh fredrik at pythonware.com
Thu May 12 14:22:24 EDT 2005


Carlos Moreira wrote:

> Are you talking about:
> http://docs.python.org/tut/tut.html
>
> I fear that doesn't exist one word about polymorphism
> (in an explicit way).

so phrases like

    "Strings can be concatenated (glued together) with the + operator,
    and repeated with *"

    "Like string indices, list indices start at 0, and lists can be sliced,
    concatenated and so on"

    "The built-in function len() also applies to lists"

    "Python's for statement iterates over the items of any sequence"

    "The statement result.append(b) calls a method of the list object
    result. A method is a function that 'belongs' to an object and is
    named obj.methodname, where obj is some object (this may be an
    expression), and methodname is the name of a method that is
    defined by the object's type. Different types define different
    methods. Methods of different types may have the same name
    without causing ambiguity."

    (etc)

doesn't tell you that polymorphism is a fundamental part of the language,
and used all over the place.  or did you have a non-OO meaning of the
word in mind?

</F>






More information about the Python-list mailing list