Are dictionaries the same as hashtables?

2008-08-26 Thread cnb
Are dictionaries the same as hashtables? -- http://mail.python.org/mailman/listinfo/python-list

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Martin Marcher
On 2008-08-26 00:32:20, cnb wrote: Are dictionaries the same as hashtables? Yes, but there is nothing in there that does sane collision handling like making a list instead of simply overwriting. PS: your sig was *a bit* longer than you question. please don't do that... signature.asc

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread cnb
On Aug 26, 9:43 am, Martin Marcher [EMAIL PROTECTED] wrote: On 2008-08-26 00:32:20, cnb wrote: Are dictionaries the same as hashtables? Yes, but there is nothing in there that does sane collision handling like making a list instead of simply overwriting. PS: your sig was *a bit* longer

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread John Machin
On Aug 26, 5:43 pm, Martin Marcher [EMAIL PROTECTED] wrote: On 2008-08-26 00:32:20, cnb wrote: Are dictionaries the same as hashtables? Yes, but there is nothing in there that does sane collision handling like making a list instead of simply overwriting. Please clarify: (1) Nothing

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Diez B. Roggisch
Martin Marcher wrote: On 2008-08-26 00:32:20, cnb wrote: Are dictionaries the same as hashtables? Yes, but there is nothing in there that does sane collision handling like making a list instead of simply overwriting. The term collision is rather well defined when talking about associative

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Ben Finney
cnb [EMAIL PROTECTED] writes: Are dictionaries the same as hashtables? The 'dict' type in Python has certain behaviour, as specified in the language reference. In CPython they are implemented as hash tables, but I don't recall anything that specifies they *must* be implemented that way. So my

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread John Machin
On Aug 26, 7:36 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Martin Marcher wrote: On 2008-08-26 00:32:20, cnb wrote: Are dictionaries the same as hashtables? Yes, but there is nothing in there that does sane collision handling like making a list instead of simply overwriting

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Martin
On Tue, Aug 26, 2008 at 9:52 AM, cnb [EMAIL PROTECTED] wrote: On Aug 26, 9:43 am, Martin Marcher [EMAIL PROTECTED] wrote: On 2008-08-26 00:32:20, cnb wrote: Are dictionaries the same as hashtables? Yes, but there is nothing in there that does sane collision handling like making a list

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Cameron Laird
In article [EMAIL PROTECTED], Diez B. Roggisch [EMAIL PROTECTED] wrote: Martin Marcher wrote: On 2008-08-26 00:32:20, cnb wrote: Are dictionaries the same as hashtables? . . . Python does not have a one key maps to a list

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Fredrik Lundh
Martin Marcher wrote: Are dictionaries the same as hashtables? Yes, but there is nothing in there that does sane collision handling like making a list instead of simply overwriting. are you sure you know what collision handling means in this context? /F -- http://mail.python.org/mailman

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Fredrik Lundh
Diez B. Roggisch wrote: I don't know the exact names of the involved structures - I named them liberally from my understanding of how associative arrays based on hashing are implemented. But the below code shows that hash-collisions can occur without corrupting data

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Diez B. Roggisch
Cameron Laird wrote: In article [EMAIL PROTECTED], Diez B. Roggisch [EMAIL PROTECTED] wrote: Martin Marcher wrote: On 2008-08-26 00:32:20, cnb wrote: Are dictionaries the same as hashtables? . . . Python does not have a one key maps to a list of values-semantics - which I consider

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Chris Mellon
On Tue, Aug 26, 2008 at 11:12 AM, Fredrik Lundh [EMAIL PROTECTED] wrote: Martin Marcher wrote: Are dictionaries the same as hashtables? Yes, but there is nothing in there that does sane collision handling like making a list instead of simply overwriting. are you sure you know what

Re: Are dictionaries the same as hashtables?

2008-08-26 Thread Cameron Laird
In article [EMAIL PROTECTED], Diez B. Roggisch [EMAIL PROTECTED] wrote: Cameron Laird wrote: In article [EMAIL PROTECTED], Diez B. Roggisch [EMAIL PROTECTED] wrote: Martin Marcher wrote: On 2008-08-26 00:32:20, cnb wrote: Are dictionaries the same as hashtables? . . . Python does not have