What is not objects in Python?

Carl Banks pavlovevidence at gmail.com
Sun Sep 28 19:32:09 EDT 2008


On Sep 28, 2:29 pm, process <circularf... at gmail.com> wrote:
> Why isn't len implemented as a str.len and list.len method instead of
> a len(list) function?

Although len() is spelled like a function call, in spirit it's an
operator, and it behaves like any other operator in Python.

Never mind why len() is an operator and not a method in Python, the
point is, just as operators like + doesn't make a language less object-
oriented (C++ would be very surprised to find out that it's not OO),
neither do operator functions like len().

Having said that, I encourage you to understanda a language for what
it is, not for whatever computer science buzzword labels it has.


Carl Banks



More information about the Python-list mailing list