Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.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.028 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'args': 0.05; 'python': 0.08; 'reply-to:addr:comp.lang.python': 0.09; 'to:addr:comp.lang.python': 0.09; 'am,': 0.12; 'wednesday,': 0.15; 'enough?': 0.16; 'ideas?': 0.16; 'parsed': 0.16; 'subject:independent': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'header:In-Reply-To:1': 0.22; 'differ': 0.23; 'interpreted': 0.23; 'string': 0.24; 'command': 0.24; 'language.': 0.28; 'lists': 0.28; 'cc:addr:python.org': 0.29; 'actions.': 0.30; 'hash': 0.30; 'subject:?': 0.31; 'list': 0.32; 'header:User-Agent:1': 0.33; 'cc:2**2': 0.34; 'from:addr:googlemail.com': 0.34; 'duplicate': 0.34; 'typical': 0.34; 'list.': 0.35; 'equal': 0.36; 'thursday,': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'linked': 0.38; 'replace': 0.38; 'some': 0.38; 'received:209.85': 0.38; 'received:209': 0.40; '2011': 0.61; 'kind': 0.61; 'order': 0.62; 'further': 0.64; 'header:Reply-To:1': 0.71; 'reply-to:no real name:2**0': 0.72; '30,': 0.74; 'reply-to:addr:googlegroups.com': 0.74; 'easy:': 0.84; 'otten': 0.84 Newsgroups: comp.lang.python Date: Thu, 1 Dec 2011 08:17:08 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=1.168.133.35; posting-account=5JdMBQoAAABHnS4mjpqEzxnmWtgiiVNw References: <30715729.411.1322753732534.JavaMail.geo-discussion-forums@pret21> User-Agent: G2/1.0 X-Google-Web-Client: true MIME-Version: 1.0 Subject: Re: order independent hash? From: 88888 Dihedral To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org, d@davea.name, 88888 Dihedral X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: comp.lang.python@googlegroups.com List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1322756236 news.xs4all.nl 6966 [2001:888:2000:d::a6]:41322 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16502 On Thursday, December 1, 2011 11:52:46 PM UTC+8, Dave Angel wrote: > On 12/01/2011 10:35 AM, 88888 Dihedral wrote: > > On Wednesday, November 30, 2011 8:47:13 PM UTC+8, Peter Otten wrote: > >> Neal Becker wrote: > >> > >>> I like to hash a list of words (actually, the command line args of my > >>> program) in such a way that different words will create different hash, > >>> but not sensitive to the order of the words. Any ideas? > >> You mean a typical python hash value which would be /likely/ to differ for > >> different lists and /guaranteed/ to be equal for equal lists is not good > >> enough? Because that would be easy: > >> > >> args = sys.argv[1:] > >> hash(tuple(sorted(args))) # consider duplicate args > > I knew a hash can replace a bi-directional linked list. > > The value can be a multi-field string to be parsed for further actions. > > Is this what you are asking? > A hash is a number, so I don't see how it can replace any kind of linked > list. Perhaps you're thinking of some other language. > > -- > > DaveA A long number of a varied length allowed but can interpreted by the programmer.