[ python-Feature Requests-960454 ] old/new class documentation

SourceForge.net noreply at sourceforge.net
Wed May 26 10:05:57 EDT 2004


Feature Requests item #960454, was opened at 2004-05-25 18:33
Message generated for change (Comment added) made by jimjjewett
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=960454&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jim Jewett (jimjjewett)
Assigned to: Nobody/Anonymous (nobody)
Summary: old/new class documentation

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: Jim Jewett (jimjjewett)
Date: 2004-05-26 10:05

Message:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=960454&group_id=5470



More information about the Python-bugs-list mailing list