Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:verizon.net': 0.07; 'terry': 0.07; 'python': 0.08; 'broken,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'broken': 0.12; 'algorithm': 0.13; '3.3.': 0.16; 'guard': 0.16; 'pydev': 0.16; 'reedy': 0.16; 'roy': 0.16; 'wrote:': 0.16; 'jan': 0.19; 'appears': 0.19; 'discussion': 0.21; 'so.': 0.21; 'header:In- Reply-To:1': 0.22; 'default,': 0.23; 'string': 0.24; 'code': 0.25; 'pm,': 0.26; 'hash': 0.30; 'anyone': 0.31; 'does': 0.32; 'header :User-Agent:1': 0.33; 'to:addr:python-list': 0.33; 'object': 0.33; 'header:X-Complaints-To:1': 0.34; 'probably': 0.35; 'something': 0.35; 'received:org': 0.37; 'unless': 0.37; 'enough': 0.37; 'stable': 0.38; 'steven': 0.38; 'option': 0.39; 'either': 0.39; 'being': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'ever': 0.64; 'stability': 0.67; 'stated': 0.70; 'empirical': 0.84; 'one).': 0.84; 'releases.': 0.91; 'attacks': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Hash stability Date: Sat, 14 Jan 2012 23:07:13 -0500 References: <4f1107b7$0$29988$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326600469 news.xs4all.nl 6842 [2001:888:2000:d::a6]:56228 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18993 On 1/14/2012 9:26 PM, Roy Smith wrote: > Steven D'Aprano wrote: >> How many people rely on hash(some_string) being stable across Python >> versions? Does anyone have code that will be broken if the string hashing >> algorithm changes? > > I would never rely on something like that unless the docs unambiguously > stated it were so. Which they don't. All I can find about hash() is: > > "Return the hash value of the object (if it has one). Based on the pydev discussion since, it appears that enough people have inferred stability either from that or empirical stability that it will not be broken, by default, in pre-3.3 releases. What ever option is chosen to guard against attacks will probably be the default in 3.3. -- Terry Jan Reedy