In article mailman.3457.1248158525.8015.python-l...@python.org,
Jack Diederich jackd...@gmail.com wrote:
On Mon, Jul 20, 2009 at 10:00 AM, Steven
D'Apranost...@remove-this-cybersource.com.au wrote:
On Mon, 20 Jul 2009 09:34:24 +, Sion Arrowsmith wrote:
Terry Reedy =A0tjre...@udel.edu
Albert van der Horst alb...@spenarnc.xs4all.nl (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
On Mon, Jul 20, 2009 at 10:00 AM, Steven
D'Apranost...@remove-this-cybersource.com.au wrote:
On Mon, 20 Jul 2009 09:34:24 +, Sion Arrowsmith wrote:
Terry Reedy tjre...@udel.edu wrote:
Sion Arrowsmith wrote:
Jack Diederich jackd...@gmail.com wrote:
It isn't an OrderedDict thing, it is a
Terry Reedy tjre...@udel.edu wrote:
Sion Arrowsmith wrote:
Jack Diederich jackd...@gmail.com 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 =
On Mon, 20 Jul 2009 09:34:24 +, Sion Arrowsmith wrote:
Terry Reedy tjre...@udel.edu wrote:
Sion Arrowsmith wrote:
Jack Diederich jackd...@gmail.com 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
Jack Diederich jackd...@gmail.com 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
Sion Arrowsmith wrote:
Jack Diederich jackd...@gmail.com 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,
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 pyshell#6, line 1, in module
On Thu, Jul 16, 2009 at 2:21 AM, Mark Summerfieldl...@qtrac.plus.com 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
d1 d2
On 16 July, 08:12, Jack Diederich jackd...@gmail.com wrote:
On Thu, Jul 16, 2009 at 2:21 AM, Mark Summerfieldl...@qtrac.plus.com 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 Summerfieldl...@qtrac.plus.com 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
d1 d2
Mark l...@qtrac.plus.com (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), (k,
On 16 July, 10:21, Piet van Oostrum p...@cs.uu.nl wrote:
Mark l...@qtrac.plus.com (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
On 16 July, 08:51, Steven D'Aprano
ste...@remove.this.cybersource.com.au wrote:
On Thu, 16 Jul 2009 00:30:26 -0700, Chris Rebert wrote:
On Wed, Jul 15, 2009 at 11:21 PM, Mark Summerfieldl...@qtrac.plus.com
wrote:
Hi,
I'm just wondering why , =, =, and are not supported by
On 16 July, 11:58, Mark l...@qtrac.plus.com wrote:
On 16 July, 08:51, Steven D'Aprano
ste...@remove.this.cybersource.com.au wrote:
On Thu, 16 Jul 2009 00:30:26 -0700, Chris Rebert wrote:
On Wed, Jul 15, 2009 at 11:21 PM, Mark Summerfieldl...@qtrac.plus.com
wrote:
Hi,
I'm just
Mark wrote:
On 16 July, 10:21, Piet van Oostrum p...@cs.uu.nl 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
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 seems a bit
17 matches
Mail list logo