modifying __new__ of list subclass

Ken Schutte kschutte at csail.mit.edu
Tue Aug 15 18:17:47 EDT 2006


Steven Bethard wrote:
> So even though your __new__ method returns the object you want, the 
> __init__ method is clearing out all the items you've added and then 
> re-adding them as it normally would. To prove this to yourself, take a 
> look at what happens when we override __init__::
> 

Okay, I see what's happening now.  Steve and Alex - thanks for the great 
explanations.

Ken



More information about the Python-list mailing list