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


Groups > comp.lang.python > #20136

Re: frozendict

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!82.197.223.106.MISMATCH!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'differently.': 0.07; 'nasty': 0.07; 'received:verizon.net': 0.07; 'terry': 0.07; 'versions.': 0.07; 'python': 0.08; 'dict': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'variants': 0.09; 'creation.': 0.16; 'predictable': 0.16; 'reedy': 0.16; 'suggested,': 0.16; 'language': 0.16; 'url:bugs': 0.17; 'wrote:': 0.18; 'jan': 0.19; 'have,': 0.21; 'header:In-Reply-To:1': 0.22; 'structure': 0.26; 'code.': 0.26; 'function': 0.27; 'random': 0.28; 'assuming': 0.29; 'pm,': 0.29; 'hash': 0.30; 'source': 0.32; 'anyone': 0.32; 'there': 0.33; 'header:User-Agent:1': 0.33; 'header:X-Complaints- To:1': 0.34; 'to:addr:python-list': 0.35; 'however,': 0.35; 'url:python': 0.35; 'received:org': 0.36; 'created': 0.37; 'several': 0.38; 'think': 0.38; 'data': 0.38; 'url:org': 0.39; 'focus': 0.39; 'to:addr:python.org': 0.40; 'more': 0.61; 'your': 0.61; 'believe': 0.65; 'day': 0.68; 'order,': 0.73; 'salt': 0.77; 'serious': 0.78; '100%': 0.82; 'nathan': 0.84; 'ubiquitous': 0.84; '3.3': 0.91; 'surprise': 0.97
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: frozendict
Date Thu, 09 Feb 2012 22:33:16 -0500
References <4F332007.9080800@wisc.edu> <jgv9ps$35g$1@dough.gmane.org> <mailman.5558.1328759017.27778.python-list@python.org> <Xns9FF46B35EDFF9duncanbooth@127.0.0.1> <mailman.5588.1328798176.27778.python-list@python.org> <Xns9FF497406322duncanbooth@127.0.0.1> <CAOFbRmJLyNA=-oM3eyASVE0EzA6SrjguP7Lv1Vsj2qA4=qU-cw@mail.gmail.com> <mailman.5597.1328805384.27778.python-list@python.org> <4f3471e9$0$29986$c3e8da3$5496439d@news.astraweb.com> <CAOFbRmJN=XicYeUjN9+a800FqvRGigA4p_88mU=Pj1ZRtcgwfw@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-74-109-121-73.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
In-Reply-To <CAOFbRmJN=XicYeUjN9+a800FqvRGigA4p_88mU=Pj1ZRtcgwfw@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5635.1328844905.27778.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1328844905 news.xs4all.nl 6891 [2001:888:2000:d::a6]:42762
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20136

Show key headers only | View raw


On 2/9/2012 9:30 PM, Nathan Rice wrote:

>> That day may be sooner than you think. It is very likely that in Python
>> 3.3, dict order will be randomized on creation as a side-effect of adding
>> a random salt to hashes to prevent a serious vulnerability in dicts.
>>
>> http://securitytracker.com/id/1026478
>>
>> http://bugs.python.org/issue13703
>>
>>
>> If there is anyone still assuming that dicts have a predictable order,
>> they're going to be in for a nasty surprise one of these days.
>
> The only thing needed to avoid the hash collision is that your hash
> function is not not 100% predictable just by looking at the python
> source code.  I don't see why every dict would have to be created
> differently.  I would think having the most ubiquitous data structure
> in your language be more predictable would be a priority.  Oh well....

I believe 'on creation' means 'on process startup', not on dict 
creation. There have, however, been several variants suggested, and the 
focus has been on choosing one first for past and current versions. 3.3 
is about 6 months off and hash for it may still be debated.

-- 
Terry Jan Reedy

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


Thread

Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-08 22:43 -0500
  Re: frozendict Duncan Booth <duncan.booth@invalid.invalid> - 2012-02-09 10:33 +0000
    Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-09 09:36 -0500
      Re: frozendict Duncan Booth <duncan.booth@invalid.invalid> - 2012-02-09 14:52 +0000
        Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-09 10:19 -0500
          Re: frozendict Duncan Booth <duncan.booth@invalid.invalid> - 2012-02-09 18:47 +0000
        Re: frozendict Ian Kelly <ian.g.kelly@gmail.com> - 2012-02-09 09:35 -0700
          Re: frozendict Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-10 01:24 +0000
            Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-09 21:30 -0500
            Re: frozendict Terry Reedy <tjreedy@udel.edu> - 2012-02-09 22:33 -0500
            Re: frozendict Chris Angelico <rosuav@gmail.com> - 2012-02-10 21:08 +1100
            Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-10 11:53 -0500
            Re: frozendict Chris Rebert <clp2@rebertia.com> - 2012-02-10 09:00 -0800
            Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-10 13:14 -0500
              Re: frozendict John Nagle <nagle@animats.com> - 2012-02-10 10:57 -0800
                Re: frozendict 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-10 21:52 -0800
                Re: frozendict John Nagle <nagle@animats.com> - 2012-02-13 13:15 -0800
        Re: frozendict Nathan Rice <nathan.alexander.rice@gmail.com> - 2012-02-09 11:50 -0500

csiph-web