Re: Looking for magic method to override to prevent dict(d) from grabbing subclass inst d contents directly

2005-11-22 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: >>I'm not sure exactly what you mean by "grabbing sublass inst d contens >>directly", but if dict(d.items()) does it, the above class should do >>it as well. Of course, *other* ways of initializing a dict won't work >>for this class. >> > It's not initializ

Re: Looking for magic method to override to prevent dict(d) from grabbing subclass inst d contents directly

2005-11-22 Thread Bengt Richter
On Tue, 22 Nov 2005 09:30:49 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Bengt Richter) writes: >> Has anyone found a way besides not deriving from dict? >> Shouldn't there be a way? >> TIA >> (need this for what I hope is an improvement on the Larosa/Foord OrderedDict >> ;-)

Re: Looking for magic method to override to prevent dict(d) from grabbing subclass inst d contents directly

2005-11-22 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > Has anyone found a way besides not deriving from dict? > Shouldn't there be a way? > TIA > (need this for what I hope is an improvement on the Larosa/Foord OrderedDict > ;-) > > I guess I can just document that you have to spell it dict(d.items()), but I

Looking for magic method to override to prevent dict(d) from grabbing subclass inst d contents directly

2005-11-21 Thread Bengt Richter
Has anyone found a way besides not deriving from dict? Shouldn't there be a way? TIA (need this for what I hope is an improvement on the Larosa/Foord OrderedDict ;-) I guess I can just document that you have to spell it dict(d.items()), but I'd like to hide the internal shenanigans ;-) Regards, B