What is not objects in Python?

Tino Wildenhain tino at wildenhain.de
Sun Sep 28 20:41:59 CEST 2008


process wrote:
> I have heard some criticism about Python, that it is not fully object-
> oriented.

Don't listen to the voices... ;)

> What is not an object in Python?

> Why isn't len implemented as a str.len and list.len method instead of
> a len(list) function?

So you also want to write 1+2 in the form of 1.add(2) ?
(Yes, in python you can do that, as well as "hello".__len__() works
  even (1).__add__(2) works.)
Maybe its just that python don't want to waste good names for methods :-)

So as said above in some other thread, python supports OO but does not
force to write OO.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20080928/11c4e4e9/attachment.bin>

More information about the Python-list mailing list