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!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'thread,': 0.04; 'python': 0.08; 'compute': 0.09; 'to:addr:comp.lang.python': 0.09; 'tuple': 0.09; 'am,': 0.12; 'algorithm': 0.13; 'stored': 0.13; '10:17': 0.16; 'subject:independent': 0.16; '\xc2\xa0i': 0.16; 'cc:addr :python-list': 0.16; 'mon,': 0.16; 'wrote:': 0.18; 'position,': 0.19; 'trying': 0.21; 'pointed': 0.21; 'dec': 0.22; 'header:In- Reply-To:1': 0.22; 'dictionary': 0.23; 'pair': 0.23; 'table.': 0.23; 'cc:2**0': 0.24; "python's": 0.24; 'function': 0.27; 'url:mailman': 0.28; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.29; 'hash': 0.30; 'objects.': 0.30; 'oop': 0.30; 'sun,': 0.30; 'subject:?': 0.31; 'objects': 0.32; 'url:listinfo': 0.32; 'idea': 0.32; 'this.': 0.33; 'done': 0.34; 'it.': 0.34; 'all.': 0.34; 'then.': 0.34; 'list.': 0.35; 'something': 0.35; 'sets': 0.35; 'url:python': 0.36; 'explain': 0.36; 'received:209.85.161': 0.36; 'thread': 0.37; 'received:google.com': 0.37; 'think': 0.37; 'maps': 0.38; 'monday,': 0.38; 'some': 0.38; 'several': 0.38; 'received:209.85': 0.38; 'ways': 0.39; 'talk': 0.39; 'url:org': 0.39; 'called': 0.40; 'received:209': 0.40; 'type': 0.61; '2011': 0.61; 'power': 0.63; 'sets,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=9Wpu1fWA9TlPhEYzObiwIc+6XAAKJ4LflSSCvIJN9Yk=; b=x4tpK28/cqOXiPCxBY/n1XFYY0w6MDjXFViGN7Q50+Hj+C4QwrKxB3Fu1DposzQbPQ GWaFtKmkn3XssVNiNPfeBWW9lsyaa3rQ6h+u2LKV/FR+IIgE994PSXY4Nt1HO+/+gtc8 wOp5M4vdNBH0g+dnsEh9vgfq44bpWBtkM36zg= MIME-Version: 1.0 In-Reply-To: <12469565.1384.1323040641935.JavaMail.geo-discussion-forums@prfj18> References: <30715729.411.1322753732534.JavaMail.geo-discussion-forums@pret21> <4ED7A2CE.6070306@davea.name> <6366868.86.1322800180523.JavaMail.geo-discussion-forums@pret21> <3MKCq.194015$th7.47228@newsfe07.ams2> <26969335.380.1323013143216.JavaMail.geo-discussion-forums@prnu18> <27797359.1293.1323021983756.JavaMail.geo-discussion-forums@prfb10> <12469565.1384.1323040641935.JavaMail.geo-discussion-forums@prfj18> From: Matt Joiner Date: Mon, 5 Dec 2011 10:21:12 +1100 Subject: Re: order independent hash? To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Python 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: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1323040901 news.xs4all.nl 6884 [2001:888:2000:d::a6]:39378 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:16628 Duh. What's the point you're trying to make? On Mon, Dec 5, 2011 at 10:17 AM, 88888 Dihedral wrote: > On Monday, December 5, 2011 4:13:01 AM UTC+8, Ian wrote: >> On Sun, Dec 4, 2011 at 11:06 AM, 88888 Dihedral >> wrote: >> >> If you want to talk about ways to use dicts, please start a different >> >> thread for it. =C2=A0As has been pointed out several times now, it is >> >> off-topic for this thread, which is about hash *functions*. >> > >> > A hash that can hash objects is not a hash function at all. >> >> Please explain what you think a hash function is, then. =C2=A0Per >> Wikipedia, "A hash function is any algorithm or subroutine that maps >> large data sets to smaller data sets, called keys." >> >> > Are you miss-leading the power of true OOP ? >> >> I have no idea what you are suggesting. =C2=A0I was not talking about OO= P at all. > > In python the (k,v) pair in a dictionary k and v can be =C2=A0both an obj= ects. > v can be a tuple or a list. =C2=A0There are some restrictions on k to be = an > =C2=A0hashable type in python's implementation. The key is used to comput= e the position of the pair to be stored in a =C2=A0hash table. The hash fun= ction maps key k to the position in the hash table. If k1!=3Dk2 are both = =C2=A0mapped to the same > position, then something has to be done to resolve this. > > > > > > > -- > http://mail.python.org/mailman/listinfo/python-list --=20 =E0=B2=A0_=E0=B2=A0