Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-10-02 Thread Terry Reedy
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Subclassing doesn't have to imply a common implementation, just a common | interface. True, but in Python, subclassing is usually done to reuse implementation. Interface subclassing is usually from a common abstract ba

RE: sorteddict [was a PEP proposal, but isn't anymore!]

2007-10-01 Thread Duncan Booth
"Hamilton, William " <[EMAIL PROTECTED]> wrote: >> From: thebjorn >> What's stabledict? I'm assuming that ordereddict is a mapping that >> maintains insertion order(?) > > Yes, ordereddict is a dict that maintains insertion order. Stabledict > is probably a dict that maintains _an_ order, so tha

RE: sorteddict [was a PEP proposal, but isn't anymore!]

2007-10-01 Thread Hamilton, William
> From: thebjorn > What's stabledict? I'm assuming that ordereddict is a mapping that > maintains insertion order(?) Yes, ordereddict is a dict that maintains insertion order. Stabledict is probably a dict that maintains _an_ order, so that repr() and the like return the same value when used on d

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-29 Thread thebjorn
On Sep 29, 7:13 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: [...] > Right now I think there are probably three dict variants needed: sorteddict > (still waiting for a convincing use case), ordereddict (lots of use cases), > and this one: stabledict. What's stabledict? I'm assuming that ordereddict

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-29 Thread Duncan Booth
thebjorn <[EMAIL PROTECTED]> wrote: > On Sep 29, 4:23 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > [...] >> Another example would be if you had a library which serialised a >> dictionary to xml. There is nothing wrong with the library if it >> doesn't care about order, but if you have some other

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-29 Thread thebjorn
On Sep 29, 4:23 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: [...] > Another example would be if you had a library which serialised a dictionary > to xml. There is nothing wrong with the library if it doesn't care about > order, but if you have some other reason why you want the xml to be stable > (

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-29 Thread Duncan Booth
Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2007-09-27, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > >> Is this a practical use case? When are sequential visits of all >> elements in order frequently suspended to make insertions and >> deletions, with a need for efficient lookup by key? > >

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-29 Thread Antoon Pardon
On 2007-09-27, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Is this a practical use case? When are sequential visits of all > elements in order frequently suspended to make insertions and > deletions, with a need for efficient lookup by key? Does it need to be a sequential visit of *all* elemen

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-27 Thread gatti
I don't see a focused discussion of computational complexity of a sorted dict; its API cannot be simpler than sorting a dictionary and it has issues and complications that have already been discussed without completely satisfactory solutions, so the only possible reason to adopt a sorted dict is th

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-27 Thread Mark Summerfield
On 26 Sep, 18:59, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [Mark Summerfield] > > > Below is a PEP proposal for a sorteddict. It arises out of a > > discussion on this list that began a few weeks ago with the subject of > > "An ordered dictionary for the Python library?" > > It is worth remem