Re: a question on python dict

2007-01-03 Thread Tim Peters
[Tim Peters] >> ... >> Taking my response out of context to begin with doesn't really change >> that I answered the question he asked ;-) [Fredrik Lundh] > welcome to comp.lang.python. > > Thanks for the welcome! It's tough to be a newbie here ;-) -- http://mail.python.org/mailman/listinfo/p

Re: a question on python dict

2007-01-03 Thread Fredrik Lundh
Tim Peters wrote: > Taking my response out of context to begin with doesn't really change that > I answered the question he asked ;-) welcome to comp.lang.python. -- http://mail.python.org/mailman/listinfo/python-list

Re: a question on python dict

2006-12-31 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Tim Peters wrote: > [Tim Peters] > You should also note that copying a dict key or value (no matter of > what type) consists in its entirety of copying one machine address (a > 4- or 8-byte pointer, depending on platform). > > [Lawrence D'Oliveiro]

Re: a question on python dict

2006-12-31 Thread Tim Peters
[Tim Peters] You should also note that copying a dict key or value (no matter of what type) consists in its entirety of copying one machine address (a 4- or 8-byte pointer, depending on platform). [Lawrence D'Oliveiro] >>> Actually, no. It also consists of updating reference counts

Re: a question on python dict

2006-12-31 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Tim Peters wrote: > [Tim Peters] >>> You should also note that copying a dict key or value (no matter of >>> what type) consists in its entirety of copying one machine address (a >>> 4- or 8-byte pointer, depending on platform). > > [Lawrence D'Oliveiro] >> Actuall

Re: a question on python dict

2006-12-31 Thread Tim Peters
[Tim Peters] >> You should also note that copying a dict key or value (no matter of >> what type) consists in its entirety of copying one machine address (a >> 4- or 8-byte pointer, depending on platform). [Lawrence D'Oliveiro] > Actually, no. It also consists of updating reference counts as well.

Re: a question on python dict

2006-12-30 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Tim Peters wrote: > You should also note that copying a dict key or value (no matter of > what type) consists in its entirety of copying one machine address (a > 4- or 8-byte pointer, depending on platform). Actually, no. It also consists of updating reference coun

Re: a question on python dict

2006-12-21 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > Thank you very much for your explanation! > > I made a mistake that I said the hash value should be recalculated > each time the dict resize, what I wanted to say was that the position > of each item should be recalculated. > > Maybe I should take a look at the source

Re: a question on python dict

2006-12-20 Thread could . net
Thank you very much for your explanation! I made a mistake that I said the hash value should be recalculated each time the dict resize, what I wanted to say was that the position of each item should be recalculated. Maybe I should take a look at the source code of python dict some day. I'll some

Re: a question on python dict

2006-12-20 Thread Tim Peters
[EMAIL PROTECTED] > Python dict is a hash table, isn't it? Yup. > I know that hashtable has the concept of "bucket size" and "min bucket > count" stuff, Some implementations of hash tables do. Python's does not. Python's uses what's called "open addressing" instead. > and they should be confi

a question on python dict

2006-12-20 Thread could . net
Python dict is a hash table, isn't it? I know that hashtable has the concept of "bucket size" and "min bucket count" stuff, and they should be configurable so I can set them to the proper value when I know how many items I'm going to handle. If these two values can't be set, the hashtable will gi