Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75502

Re: Dict when defining not returning multi value key error

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin1!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'subject:not': 0.03; 'model,': 0.05; 'true,': 0.05; 'assuming': 0.09; 'bits': 0.09; 'encode': 0.09; 'imply': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'used.': 0.09; 'jan': 0.12; 'hashes': 0.16; 'mercurial,': 0.16; "object's": 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:key': 0.16; 'subject:when': 0.16; 'wrote:': 0.18; 'bit': 0.19; '>>>': 0.22; 'header:User-Agent:1': 0.23; '(or': 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'statement': 0.30; 'assumes': 0.31; 'large.': 0.31; 'probability': 0.31; 'actual': 0.34; 'computing': 0.35; 'equal': 0.35; 'objects': 0.35; 'but': 0.35; 'version': 0.36; 'false': 0.36; 'to:addr:python-list': 0.38; 'does': 0.39; 'received:71': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'algorithms': 0.60; 'more': 0.64; 'fact,': 0.69; 'internet': 0.71; 'carefully': 0.74; 'gotten': 0.74; '160': 0.84; 'received:fios.verizon.net': 0.84; 'trouble.': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Dict when defining not returning multi value key error
Date Fri, 01 Aug 2014 17:42:10 -0400
References <CAFBK5a-hjukHaHOim4tL_RerXiHsFP03eaQoN42yGfeCJ9NZPg@mail.gmail.com> <CAGGBd_riruS0nRM9+o+1dz=jVZgYOo09qX97P+LWK5Nu6HTYRw@mail.gmail.com> <mailman.12501.1406862741.18130.python-list@python.org> <53db11c1$0$29986$c3e8da3$5496439d@news.astraweb.com> <mailman.12503.1406866676.18130.python-list@python.org> <53db96bc$0$29986$c3e8da3$5496439d@news.astraweb.com> <mailman.12512.1406901485.18130.python-list@python.org> <87vbqcnrrh.fsf@elektro.pacujo.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-71-175-90-87.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <87vbqcnrrh.fsf@elektro.pacujo.net>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12525.1406929354.18130.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1406929354 news.xs4all.nl 2926 [2001:888:2000:d::a6]:34163
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75502

Show key headers only | View raw


On 8/1/2014 11:39 AM, Marko Rauhamaa wrote:
> Chris Angelico <rosuav@gmail.com>:
>
>>> but hash(x) == hash(y) does NOT imply that x == y.
>>
>> Hello, pigeonhole principle :) If this were false - that is, if equal
>> hashes DID imply equal objects - it would be necessary to completely
>> encode an object's state in its hash, and hashes would be impossibly
>> large. This would, in fact, destroy their value completely.
>
> Well, modern computing assumes precisely:
>
>     hash(x) == hash(y) => x == y

Assuming that a false statement is true does not make it true, and can 
and has gotten 'computing' into trouble.

> That principle is at play with strong authentication (HTTPS et al),
> version control (git et al),

The principle for these applications is

stronghash(x) == stronghash(y) => x == y with probability 1 (or 
indistinguishable from 1).

For mercurial, with no treat model, a 160 bit hash is used. Internet 
applications need more bits and carefully vetted algorithms to hopefully 
make the actual principle true.

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Dict when defining not returning multi value key error Dan Stromberg <drsalists@gmail.com> - 2014-07-31 20:12 -0700
  Re: Dict when defining not returning multi value key error Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-01 04:04 +0000
    Re: Dict when defining not returning multi value key error Ben Finney <ben+python@benfinney.id.au> - 2014-08-01 14:17 +1000
      Re: Dict when defining not returning multi value key error Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-01 13:31 +0000
        Re: Dict when defining not returning multi value key error Chris Angelico <rosuav@gmail.com> - 2014-08-01 23:57 +1000
          Re: Dict when defining not returning multi value key error Marko Rauhamaa <marko@pacujo.net> - 2014-08-01 18:39 +0300
            Re: Dict when defining not returning multi value key error Terry Reedy <tjreedy@udel.edu> - 2014-08-01 17:42 -0400
            Re: Dict when defining not returning multi value key error Chris Angelico <rosuav@gmail.com> - 2014-08-02 09:57 +1000
              Re: Dict when defining not returning multi value key error Marko Rauhamaa <marko@pacujo.net> - 2014-08-02 09:41 +0300
                Re: Dict when defining not returning multi value key error Marko Rauhamaa <marko@pacujo.net> - 2014-08-02 10:06 +0300
                Re: Dict when defining not returning multi value key error Chris Angelico <rosuav@gmail.com> - 2014-08-02 20:58 +1000
            Re: Dict when defining not returning multi value key error Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-02 11:47 +1000
              Re: Dict when defining not returning multi value key error Chris Angelico <rosuav@gmail.com> - 2014-08-02 12:13 +1000

csiph-web