This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: old/new class documentation
Type: enhancement Stage:
Components: Documentation Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eldiener, jimjjewett, zseil
Priority: normal Keywords:

Created on 2004-05-25 22:33 by jimjjewett, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg54165 - (view) Author: Jim Jewett (jimjjewett) Date: 2004-05-25 22:33
The distributed documentation refers to old and 
new-style classes, but they do not appear in the index, 
and the difference is not explained.  (Users who ask are 
referred to documentation on www.python.org, which is 
not currently shipped with the default distrubution.)  

As best I understand it, the only differences are:

(1)  New-style classes inherit from object.  
Because of this inheritance, new-style classes have a 
few extra capabilities, such as descriptors and super.

(2)  Method Resolution Order can be different in cases of 
multiple inheritance.

(3)  New style classes take precedence over old-style 
classes when doing rich comparison.

(4)  If rich comparison fails, numeric coercion will be 
attempted if -- and only if -- at least one of the objects 
is an old-style class.
msg54166 - (view) Author: Jim Jewett (jimjjewett) Date: 2004-05-26 14:05
Logged In: YES 
user_id=764593

Given that the differences are almost -- but not entirely -- 
extra options for new-style classes, the language lawyer 
section on classes (ref/7.6) might be a good location.
msg54167 - (view) Author: Jim Jewett (jimjjewett) Date: 2004-05-26 15:21
Logged In: YES 
user_id=764593

Found a new difference -- you can't assign to the __bases__ 
or __name__ of a new-style class, and you can't usually 
assign to it's __class__.
msg54168 - (view) Author: Edward Diener (eldiener) Date: 2004-08-01 23:53
Logged In: YES 
user_id=490593

New style classes, with all their new attributes, member 
functions, static methods, and class methods, need to be 
documented in the official Python distribution. Included in this 
is the explanation of metaclasses and how to use them. 
Essentially Guido's paper on new style classes, reworked to fit 
within the existing documentation framework, should be added 
to the official documantation..
msg54169 - (view) Author: Ziga Seilnacht (zseil) * (Python committer) Date: 2006-04-10 14:07
Logged In: YES 
user_id=1326842

This seems like a duplicate of bug #960340, which
was closed when section New-style and classic classes
was added to the Python Reference Manual
(see http://docs.python.org/dev/ref/node33.html).
msg54170 - (view) Author: Jim Jewett (jimjjewett) Date: 2006-04-12 18:07
Logged In: YES 
user_id=764593


History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40291
2004-05-25 22:33:18jimjjewettcreate