Article View: pl.comp.lang.python
Article #27218Re: Python a hashmapa
From: Łukasz Rekucki
Date: Mon, 11 Jan 2010 20:13
Date: Mon, 11 Jan 2010 20:13
14 lines
2055 bytes
2055 bytes
On Jan 11, 8:15 pm, wodzik <wod...@noreply.com> wrote: > Chyba działa to na takiej zasadzie, że hash ustala miejsce gdzie ma być > wstawione, a cmp sprawdza, czy to co już jest wstawione nie jest takie > samo, jak to co chcemy wstawić i dlatego musimy mieć oba... Coś nie mogę > się dokopać do tego w dokumentacji. http://docs.python.org/reference/datamodel.html#object.__hash__ http://docs.python.org/3.1/reference/datamodel.html#object.__hash__ """If a class does not define a __cmp__() or __eq__() method it should not define a __hash__() operation either;""" (przy okazji, __cmp__ jest wycofywane i nie będzie dostępne w py3k, lepiej użyć __eq__)
Technical Details
Message-ID:
<17521eee-a12d-4df3-a8ba-ea88712cbeba@m26g2000yqb.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!feed.news.interia.pl!news.nask.pl!news.nask.org.pl!news.uni-stuttgart.de!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!proxad.net!feeder1-2.proxad.net!74.125.46.134.MISMATCH!postnews.google.com!m26g2000yqb.googlegroups.com!not-for-mailReferences:
<hi9a48$c1b$1@zeus.man.szczecin.pl> <hifse1$rn5$1@zeus.man.szczecin.pl> <hiftcg$s4b$1@zeus.man.szczecin.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!feed.news.interia.pl!news.nask.pl!news.nask.org.pl!news.uni-stuttgart.de!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!proxad.net!feeder1-2.proxad.net!74.125.46.134.MISMATCH!postnews.google.com!m26g2000yqb.googlegroups.com!not-for-mail From: Łukasz Rekucki <lrekucki@gmail.com> Newsgroups: pl.comp.lang.python Subject: Re: Python a hashmapa Date: Mon, 11 Jan 2010 12:13:09 -0800 (PST) Organization: http://groups.google.com Lines: 16 Message-ID: <17521eee-a12d-4df3-a8ba-ea88712cbeba@m26g2000yqb.googlegroups.com> References: <hi9a48$c1b$1@zeus.man.szczecin.pl> <hifse1$rn5$1@zeus.man.szczecin.pl> <hiftcg$s4b$1@zeus.man.szczecin.pl> NNTP-Posting-Host: 212.76.62.207 Mime-Version: 1.0 X-Trace: posting.google.com 1263240789 23405 127.0.0.1 (11 Jan 2010 20:13:09 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 11 Jan 2010 20:13:09 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m26g2000yqb.googlegroups.com; posting-host=212.76.62.207; posting-account=5fpXZwoAAADF-CUdCuJ-FpYxG8__-wRx User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5,gzip(gfe),gzip(gfe) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit