Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30499 > unrolled thread

Re: [RELEASED] Python 3.3.0

Started byChristian Heimes <christian@python.org>
First post2012-09-29 16:06 +0200
Last post2012-09-29 16:06 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RELEASED] Python 3.3.0 Christian Heimes <christian@python.org> - 2012-09-29 16:06 +0200

#30499 — Re: [RELEASED] Python 3.3.0

FromChristian Heimes <christian@python.org>
Date2012-09-29 16:06 +0200
SubjectRe: [RELEASED] Python 3.3.0
Message-ID<mailman.1631.1348927583.27098.python-list@python.org>
Am 29.09.2012 15:42, schrieb Andriy Kornatskyy:
> 
> The following doctest fails with python3.3 (it is okay for python2.4-2.7, 3.2).
> 
> class adict(dict):                                                                                            
>     """                                                                                                      
>         >>> d = adict(a=1, b=2)                                                                              
>         >>> d                                                                                                
>         {'a': 1, 'b': 2}                                                                                      
>     """                                                                                                      
>                                                                                                              
> if __name__ == "__main__":                                                                                    
>     import doctest                                                                                            
>     doctest.testmod() 
> 
> Please advise if that is something known.

Yes, it's caused by the hash randomization. From now on you can't rely
on the order of an unordered type like dict or set. You could replace d
with sorted(d.items()).

Christian

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web