Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.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.024 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'python': 0.08; 'dict': 0.09; 'received:209.85.210.174': 0.13; 'received:mail- iy0-f174.google.com': 0.13; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'okay,': 0.16; 'subject:independent': 0.16; 'values?': 0.16; 'header:In-Reply- To:1': 0.22; 'tree': 0.25; 'classes': 0.26; 'tried': 0.27; 'message-id:@mail.gmail.com': 0.28; 'hash': 0.30; "it'd": 0.30; 'subject:?': 0.31; 'implement': 0.32; 'to:addr:python-list': 0.34; 'probably': 0.34; 'things,': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'useful': 0.38; 'correctly': 0.39; "couldn't": 0.39; 'define': 0.39; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'comply': 0.67; 'technically': 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; bh=iXjg2G6h9hcFG+egIFaQyuCJmEuixVZxNqoU/WZt/cU=; b=PxrZVxESQt+1quTtF896zfKV6biU5tlmC7gVm8obRIozRB/lUN1UMByE+I+ZM6MUGw 0eZ/9ZHgR+ir3EojsWvPb6EO8X/OP/u2g5lxyHMIx8UDn+pmcbhk1e2OaVai5rp1bGXC fCXCv/uBIqU1nc1qteoMCY7fCIC0CTzKp9EAs= MIME-Version: 1.0 In-Reply-To: <87aa78bfvv.fsf@xemacs.org> References: <30715729.411.1322753732534.JavaMail.geo-discussion-forums@pret21> <4ED7A2CE.6070306@davea.name> <6366868.86.1322800180523.JavaMail.geo-discussion-forums@pret21> <87k46fb8pg.fsf@xemacs.org> <87aa78bfvv.fsf@xemacs.org> Date: Mon, 5 Dec 2011 01:08:53 +1100 Subject: Re: order independent hash? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1323007736 news.xs4all.nl 6847 [2001:888:2000:d::a6]:40152 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16609 2011/12/5 Hrvoje Niksic : > If a Python > implementation tried to implement dict as a tree, instances of classes > that define only __eq__ and __hash__ would not be correctly inserted in > such a dict. Couldn't you just make a tree of hash values? Okay, that's probably not the most useful way to do things, but technically it'd comply with the spec. ChrisA