> Albert van der Horst (AvdH) wrote:
>AvdH> With regard to < and > you are right.
>AvdH> But I think there is a sensible == w.r.t. dict's.
>AvdH> It is to mean that for each key dict1(key) == dict2(key)
>AvdH> (implying that their key set must be the same)
>AvdH> [I could have used that fo
In article ,
Jack Diederich wrote:
>On Mon, Jul 20, 2009 at 10:00 AM, Steven
>D'Aprano wrote:
>> On Mon, 20 Jul 2009 09:34:24 +, Sion Arrowsmith wrote:
>>
>>> Terry Reedy =A0 wrote:
Sion Arrowsmith wrote:
> Jack Diederich =A0 wrote:
>> It isn't an OrderedDict thing, it is a compar
On Mon, Jul 20, 2009 at 10:00 AM, Steven
D'Aprano wrote:
> On Mon, 20 Jul 2009 09:34:24 +, Sion Arrowsmith wrote:
>
>> Terry Reedy wrote:
>>>Sion Arrowsmith wrote:
Jack Diederich wrote:
> It isn't an OrderedDict thing, it is a comparison thing. Two regular
> dicts also raise a
On Mon, 20 Jul 2009 09:34:24 +, Sion Arrowsmith wrote:
> Terry Reedy wrote:
>>Sion Arrowsmith wrote:
>>> Jack Diederich wrote:
It isn't an OrderedDict thing, it is a comparison thing. Two regular
dicts also raise an error if you try to LT them.
>>> Python 2.5.2
>> d1 = dict(
Terry Reedy wrote:
>Sion Arrowsmith wrote:
>> Jack Diederich wrote:
>>> It isn't an OrderedDict thing, it is a comparison thing. Two regular
>>> dicts also raise an error if you try to LT them.
>> Python 2.5.2
> d1 = dict((str(i), i) for i in range (10))
> d2 = dict((str(i), i) for i i
Sion Arrowsmith wrote:
Jack Diederich wrote:
It isn't an OrderedDict thing, it is a comparison thing. Two regular
dicts also raise an error if you try to LT them.
Since when?
Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "lice
Jack Diederich wrote:
>It isn't an OrderedDict thing, it is a comparison thing. Two regular
>dicts also raise an error if you try to LT them.
Since when?
Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information
On Thu, 16 Jul 2009 03:59:47 -0700, Mark wrote:
>> > Or maybe not. If OrderedDicts are sequences as well as mappings, then we
>> > should be able to sort them. And that seems a bit much even for me.
>> One thing that I've just noticed is that you can use <, <=, >=, and >
>> with sets:
>> It seem
Mark wrote:
On 16 July, 10:21, Piet van Oostrum wrote:
But why should the order be as if the OrderedDict was a list of tuples.
A dict can be considered as a mapping and then you might want to treat
either the key or the value as contravariant (the key I guess). So there
is ambiguity. Why woul
On 16 July, 11:58, Mark wrote:
> On 16 July, 08:51, Steven D'Aprano
>
>
>
> wrote:
> > On Thu, 16 Jul 2009 00:30:26 -0700, Chris Rebert wrote:
> > > On Wed, Jul 15, 2009 at 11:21 PM, Mark Summerfield
> > > wrote:
> > >> Hi,
>
> > >> I'm just wondering why <, <=, >=, and > are not supported by
> >
On 16 July, 08:51, Steven D'Aprano
wrote:
> On Thu, 16 Jul 2009 00:30:26 -0700, Chris Rebert wrote:
> > On Wed, Jul 15, 2009 at 11:21 PM, Mark Summerfield
> > wrote:
> >> Hi,
>
> >> I'm just wondering why <, <=, >=, and > are not supported by
> >> collections.OrderedDict:
>
> >> >>> d1 = collec
On 16 July, 10:21, Piet van Oostrum wrote:
> > Mark (M) wrote:
> >M> You are right that it doesn't make sense to compare two dicts.
> >M> But OrderedDicts can be viewed logically as lists of (key,value)
> >M> tuples so they are much more like lists or tuples when it comes to
> >M> comparisons
> Mark (M) wrote:
>M> You are right that it doesn't make sense to compare two dicts.
>M> But OrderedDicts can be viewed logically as lists of (key,value)
>M> tuples so they are much more like lists or tuples when it comes to
>M> comparisons.
>M> For example:
> l = [("a", 1), ("z", 2),
On Thu, 16 Jul 2009 00:30:26 -0700, Chris Rebert wrote:
> On Wed, Jul 15, 2009 at 11:21 PM, Mark Summerfield
> wrote:
>> Hi,
>>
>> I'm just wondering why <, <=, >=, and > are not supported by
>> collections.OrderedDict:
>>
>> >>> d1 = collections.OrderedDict((("a",1),("z",2),("k",3))) d2 =
>>
On Wed, Jul 15, 2009 at 11:21 PM, Mark Summerfield wrote:
> Hi,
>
> I'm just wondering why <, <=, >=, and > are not supported by
> collections.OrderedDict:
>
> >>> d1 = collections.OrderedDict((("a",1),("z",2),("k",3)))
> >>> d2 = d1.copy()
> >>> d2["z"] = 4
> >>> d1 == d2
> False
>
On 16 July, 08:12, Jack Diederich wrote:
> On Thu, Jul 16, 2009 at 2:21 AM, Mark Summerfield wrote:
> > Hi,
>
> > I'm just wondering why <, <=, >=, and > are not supported by
> > collections.OrderedDict:
>
> > >>> d1 = collections.OrderedDict((("a",1),("z",2),("k",3)))
> > >>> d2 = d1.copy()
On Thu, Jul 16, 2009 at 2:21 AM, Mark Summerfield wrote:
> Hi,
>
> I'm just wondering why <, <=, >=, and > are not supported by
> collections.OrderedDict:
>
> >>> d1 = collections.OrderedDict((("a",1),("z",2),("k",3)))
> >>> d2 = d1.copy()
> >>> d2["z"] = 4
> >>> d1 == d2
> False
>
Hi,
I'm just wondering why <, <=, >=, and > are not supported by
collections.OrderedDict:
>>> d1 = collections.OrderedDict((("a",1),("z",2),("k",3)))
>>> d2 = d1.copy()
>>> d2["z"] = 4
>>> d1 == d2
False
>>> d1 < d2
Traceback (most recent call last):
File "", line
18 matches
Mail list logo