Re: Dictionary Keys question

2008-01-31 Thread Dustan
On Jan 31, 7:35 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Dustan <[EMAIL PROTECTED]> writes: > > On Jan 30, 7:02 pm, FireNWater <[EMAIL PROTECTED]> wrote: > > > Thank you for the explanation. . . I think I now have a (foggy) > > > understanding of hash tables. It seems to be a way to create order

Re: Dictionary Keys question

2008-01-31 Thread FireNWater
On Jan 31, 4:39 am, Dustan <[EMAIL PROTECTED]> wrote: > On Jan 30, 7:02 pm, FireNWater <[EMAIL PROTECTED]> wrote: > > > Thank you for the explanation. . . I think I now have a (foggy) > > understanding of hash tables. It seems to be a way to create order > > The 'order' that your speaking of is n

Re: Dictionary Keys question

2008-01-31 Thread Ben Finney
Dustan <[EMAIL PROTECTED]> writes: > On Jan 30, 7:02 pm, FireNWater <[EMAIL PROTECTED]> wrote: > > Thank you for the explanation. . . I think I now have a (foggy) > > understanding of hash tables. It seems to be a way to create order > > (an index) out of disorder (random numbers or characters) be

Re: Dictionary Keys question

2008-01-31 Thread Dustan
On Jan 30, 7:02 pm, FireNWater <[EMAIL PROTECTED]> wrote: > Thank you for the explanation. . . I think I now have a (foggy) > understanding of hash tables. It seems to be a way to create order > (an index) out of disorder (random numbers or characters) behind the > scenes. . The key thing to real

Re: Dictionary Keys question

2008-01-30 Thread Marc 'BlackJack' Rintsch
On Wed, 30 Jan 2008 17:19:13 -0800, Ryszard Szopa wrote: > BTW, can anybody explain me how is the hash function implemented in > Python? It calls the `__hash__()` method on the object that was given as argument. So there's not *the* hash function, but every type implements its own. Fallback is t

Re: Dictionary Keys question

2008-01-30 Thread Ryszard Szopa
On Jan 31, 12:08 am, Dustan <[EMAIL PROTECTED]> wrote: > The underlying order is a result, in part, of the key's hash codes*. > Integers are hash coded by their integer values, therefore, they > appear in numeric order. Strings, however, use an algorithm that > ensures as unique hash codes as poss

Re: Dictionary Keys question

2008-01-30 Thread FireNWater
On Jan 30, 3:09 pm, Berteun Damman <[EMAIL PROTECTED]> wrote: > On Wed, 30 Jan 2008 14:47:36 -0800 (PST), FireNWater <[EMAIL PROTECTED]> > wrote: > > I'm curious why the different outputs of this code. If I make the > > dictionary with letters as the keys, they are not listed in the > > dictionar

Re: Dictionary Keys question

2008-01-30 Thread Berteun Damman
On Wed, 30 Jan 2008 14:47:36 -0800 (PST), FireNWater <[EMAIL PROTECTED]> wrote: > I'm curious why the different outputs of this code. If I make the > dictionary with letters as the keys, they are not listed in the > dictionary in alphabetical order, but if I use the integers then the > keys are in

Re: Dictionary Keys question

2008-01-30 Thread Dustan
On Jan 30, 4:47 pm, FireNWater <[EMAIL PROTECTED]> wrote: > I'm curious why the different outputs of this code. If I make the > dictionary with letters as the keys, they are not listed in the > dictionary in alphabetical order, but if I use the integers then the > keys are in numerical order. > >

Re: Dictionary Keys question

2008-01-30 Thread Gabriel Genellina
En Wed, 30 Jan 2008 20:47:36 -0200, FireNWater <[EMAIL PROTECTED]> escribió: > I'm curious why the different outputs of this code. If I make the > dictionary with letters as the keys, they are not listed in the > dictionary in alphabetical order, but if I use the integers then the > keys are in n

Re: Dictionary Keys question

2008-01-30 Thread Christian Heimes
FireNWater wrote: > I'm curious why the different outputs of this code. If I make the > dictionary with letters as the keys, they are not listed in the > dictionary in alphabetical order, but if I use the integers then the > keys are in numerical order. > > I know that the order of the keys is no

Dictionary Keys question

2008-01-30 Thread FireNWater
I'm curious why the different outputs of this code. If I make the dictionary with letters as the keys, they are not listed in the dictionary in alphabetical order, but if I use the integers then the keys are in numerical order. I know that the order of the keys is not important in a dictionary, b