Re: [Python-Dev] Repeatability of looping over dicts

2008-01-05 Thread Jeffrey Yasskin
On Jan 4, 2008 12:05 PM, Tim Delaney <[EMAIL PROTECTED]> wrote: > history of insertions and deletions. If items(), keys(), values(), > iteritems(), iterkeys(), and itervalues() are called with no intervening > modifications to the dictionary, the lists will directly correspond. I looked over the J

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-05 Thread Guido van Rossum
On Jan 5, 2008 6:58 AM, <[EMAIL PROTECTED]> wrote: > > Guido> What code would break if we loosened this restriction? > > I don't know how much, but I do know I've relied on this behavior before. > (In fact, I've asked about it before.) I guess the counter question to > yours would be, "What w

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-05 Thread skip
Guido> What code would break if we loosened this restriction? I don't know how much, but I do know I've relied on this behavior before. (In fact, I've asked about it before.) I guess the counter question to yours would be, "What would be gained by loosening this restriction"? If the answer

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread Gregory P. Smith
On 1/4/08, A.M. Kuchling <[EMAIL PROTECTED]> wrote: > This post describes work aimed at getting Django to run on Jython: > http://zyasoft.com/pythoneering/2008/01/django-on-jython-minding-gap.html > > One outstanding issue is whether to use Java's ConcurrentHashMap type > to underly Jython's dict t

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread Raymond Hettinger
>> ConcurrentHashMap scales better in the face of threading .. . >> So, do Python implementations need to guarantee that list(dict_var) == >> a later result from list(dict_var)? > What code would break if we loosened this restriction? I can imagine someone has code like this: for k in d:

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread A.M. Kuchling
On Fri, Jan 04, 2008 at 02:54:49PM -0800, Guido van Rossum wrote: > What code would break if we loosened this restriction? I guess > defining d.items() as zip(d.keys(), d.values()) would no longer fly, > but does anyone actually depend on this? Just like we changed how we http://www.google.com/cod

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread Fred Drake
On Jan 4, 2008, at 5:54 PM, Guido van Rossum wrote: > What code would break if we loosened this restriction? I guess > defining d.items() as zip(d.keys(), d.values()) would no longer fly, > but does anyone actually depend on this? I don't know what code would break today; this was initially added

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread Guido van Rossum
On Jan 4, 2008 11:50 AM, A.M. Kuchling <[EMAIL PROTECTED]> wrote: > This post describes work aimed at getting Django to run on Jython: > http://zyasoft.com/pythoneering/2008/01/django-on-jython-minding-gap.html > > One outstanding issue is whether to use Java's ConcurrentHashMap type > to underly J

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread A.M. Kuchling
On Sat, Jan 05, 2008 at 07:05:55AM +1100, Tim Delaney wrote: > >So, do Python implementations need to guarantee that list(dict_var) == > >a later result from list(dict_var)? > > As I just posted to the blog, yes. Look at section 3.8 of the reference > manual > (Mapping Types), specifically footno

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread Fred Drake
On Jan 4, 2008, at 3:05 PM, Tim Delaney wrote: > As I just posted to the blog, yes. Look at section 3.8 of the > reference > manual > (Mapping Types), specifically footnote 3: You type faster than I do. :-) This guarantee has been in place for about a decade, as I recall. -Fred -- Fred

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread Tim Delaney
A.M. Kuchling wrote: > So, do Python implementations need to guarantee that list(dict_var) == > a later result from list(dict_var)? As I just posted to the blog, yes. Look at section 3.8 of the reference manual (Mapping Types), specifically footnote 3: http://docs.python.org/lib/typesmapping.ht

Re: [Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread Tim Delaney
A.M. Kuchling wrote: > So, do Python implementations need to guarantee that list(dict_var) == > a later result from list(dict_var)? As I just posted to the blog, yes. Look at section 3.8 of the reference manual (Mapping Types), specifically footnote 3: http://docs.python.org/lib/typesmapping.ht

[Python-Dev] Repeatability of looping over dicts

2008-01-04 Thread A.M. Kuchling
This post describes work aimed at getting Django to run on Jython: http://zyasoft.com/pythoneering/2008/01/django-on-jython-minding-gap.html One outstanding issue is whether to use Java's ConcurrentHashMap type to underly Jython's dict type. See