Are all classes new-style classes in 2.4+?

Rene Fleschenberg rene at korteklippe.de
Sun Dec 31 07:53:08 EST 2006


Isaac Rodriguez wrote:
> I declare property members in both and it seems to work the exact same
> way. I am using Python 2.4, and I was wondering if by default, all
> classes are assumed to be derived from "object". 

No, they are not. It's just that the "basic functionality" seems to work
the same at first glance (i.e. you don't need to learn alot of new
syntax in order to switch from old-style to new-style classes).

Play around with things like dir() and type() on old-style and new-style
classes, and you will soon see differences.

> If not, can someone
> point me to some place where I can learn more about new-style classes
> and their advantages? All the documentation I've found is very vague.

http://www.python.org/download/releases/2.2.3/descrintro/
http://www.cafepy.com/article/python_types_and_objects/python_types_and_objects.html

-- 
René
OpenPGP key id: 0x63B1F5DB
JID: rene.fleschenberg at jabber.ccc.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20061231/f99b3996/attachment.sig>


More information about the Python-list mailing list