Re: [Python-Dev] Creating dicts from dict subclasses

2006-12-14 Thread Walter Dörwald
Armin Rigo wrote: > Hi Walter, > > On Wed, Dec 13, 2006 at 05:57:16PM +0100, Walter D?rwald wrote: >> I tried to reimplement weakref.WeakValueDictionary as a subclass of >> dict. The test passes except for one problem: To compare results >> test_weakref.py converts a weakdict to a real dict via d

Re: [Python-Dev] Creating dicts from dict subclasses

2006-12-14 Thread Walter Dörwald
Guido van Rossum wrote: > On 12/13/06, Walter Dörwald <[EMAIL PROTECTED]> wrote: >> Guido van Rossum wrote: >> > On 12/13/06, Walter Dörwald <[EMAIL PROTECTED]> wrote: >> >> I tried to reimplement weakref.WeakValueDictionary as a subclass of >> >> dict. The test passes except for one problem: To co

Re: [Python-Dev] Creating dicts from dict subclasses

2006-12-13 Thread Armin Rigo
Hi Walter, On Wed, Dec 13, 2006 at 05:57:16PM +0100, Walter D?rwald wrote: > I tried to reimplement weakref.WeakValueDictionary as a subclass of > dict. The test passes except for one problem: To compare results > test_weakref.py converts a weakdict to a real dict via dict(weakdict). > This no lon

Re: [Python-Dev] Creating dicts from dict subclasses

2006-12-13 Thread Guido van Rossum
On 12/13/06, Walter Dörwald <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > On 12/13/06, Walter Dörwald <[EMAIL PROTECTED]> wrote: > >> I tried to reimplement weakref.WeakValueDictionary as a subclass of > >> dict. The test passes except for one problem: To compare results > >> test_weakre

Re: [Python-Dev] Creating dicts from dict subclasses

2006-12-13 Thread Walter Dörwald
Guido van Rossum wrote: > On 12/13/06, Walter Dörwald <[EMAIL PROTECTED]> wrote: >> I tried to reimplement weakref.WeakValueDictionary as a subclass of >> dict. The test passes except for one problem: To compare results >> test_weakref.py converts a weakdict to a real dict via dict(weakdict). >> Th

Re: [Python-Dev] Creating dicts from dict subclasses

2006-12-13 Thread Guido van Rossum
On 12/13/06, Walter Dörwald <[EMAIL PROTECTED]> wrote: > I tried to reimplement weakref.WeakValueDictionary as a subclass of > dict. The test passes except for one problem: To compare results > test_weakref.py converts a weakdict to a real dict via dict(weakdict). > This no longer works because PyD

[Python-Dev] Creating dicts from dict subclasses

2006-12-13 Thread Walter Dörwald
I tried to reimplement weakref.WeakValueDictionary as a subclass of dict. The test passes except for one problem: To compare results test_weakref.py converts a weakdict to a real dict via dict(weakdict). This no longer works because PyDict_Merge() does a PyDict_Check() on the argument and then igno