Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!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.044 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'interpreter': 0.05; 'differently.': 0.07; 'python': 0.08; 'dict': 0.09; 'run.': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'predictable': 0.16; 'received:209.85.213.174': 0.16; 'received :mail-yx0-f174.google.com': 0.16; 'language': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.22; 'feb': 0.22; 'structure': 0.26; 'code.': 0.26; 'function': 0.27; 'code,': 0.28; 'order.': 0.28; 'script': 0.28; 'message-id:@mail.gmail.com': 0.29; 'pm,': 0.29; 'hash': 0.30; 'varies': 0.30; 'nobody': 0.31; 'source': 0.32; 'that,': 0.32; "isn't": 0.33; 'fri,': 0.34; 'anything': 0.34; 'keys': 0.34; 'to:addr:python-list': 0.35; 'something': 0.35; 'created': 0.37; 'received:google.com': 0.37; 'another': 0.37; 'either': 0.37; 'received:209.85': 0.38; 'back.': 0.38; 'could': 0.38; 'think': 0.38; 'data': 0.38; 'received:209': 0.39; 'being': 0.40; 'put': 0.40; 'to:addr:python.org': 0.40; 'more': 0.61; 'your': 0.61; 'results': 0.64; 'ever': 0.64; 'series': 0.67; 'exact': 0.68; '100%': 0.82; 'different.': 0.84; 'nathan': 0.84; 'ubiquitous': 0.84; 'promised': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=eFucGqbgsT5fbz1+DqUcBUaFbiBS0AGoUUXW8FCcHkE=; b=JUmdMCP5HhTwAa1znBYHRJbgfwI/fdMkvmzfMdh2ITAQJyNd1eOzs6/uS9SrCNgh+v H2rtLuhOcBYi7WWsiVCHEn/AB6oKTeuUt56/hm9Df4IE+HyIl21PpV/Y/eC0fb9dPoiB b3IqSkAngSoRWr4lgIGKJf10UvmnkRshUHEg0= MIME-Version: 1.0 In-Reply-To: References: <4F332007.9080800@wisc.edu> <4f3471e9$0$29986$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 10 Feb 2012 21:08:04 +1100 Subject: Re: frozendict From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328868491 news.xs4all.nl 6943 [2001:888:2000:d::a6]:35811 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:20151 On Fri, Feb 10, 2012 at 1:30 PM, Nathan Rice wrote: > The only thing needed to avoid the hash collision is that your hash > function is not not 100% predictable just by looking at the python > source code. =A0I don't see why every dict would have to be created > differently. =A0I would think having the most ubiquitous data structure > in your language be more predictable would be a priority. =A0Oh well.... It's perfectly predictable. If you put a series of keys into it, you get those same keys back. Nobody ever promised anything about order. If your hash function is not 100% predictable, that means it varies on the basis of something that isn't part of either the Python interpreter or the script being run. That means that, from one execution to another of the exact same code, the results could be different. The keys will come out in different orders. ChrisA