[issue16816] Bug in hash randomization

2012-12-30 Thread Domen Kožar
Domen Kožar added the comment: I believe this is not the case, I have updated example to use ordereddict, same effect: https://gist.github.com/4409304 -- resolution: invalid - status: closed - open ___ Python tracker rep...@bugs.python.org

[issue16816] Bug in hash randomization

2012-12-30 Thread Charles-François Natali
Charles-François Natali added the comment: What exactly are you trying to demonstrate? As explained by Benjamin, the output can differ from one invokation to another because the iteration order depends on the hash value (position in the buckets). Running your script on Python 2.7 or curent

[issue16816] Bug in hash randomization

2012-12-30 Thread Domen Kožar
Domen Kožar added the comment: That would mean there is a bug in OrderedDict, since iterator of item in OrderedDict should keep the order? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16816

[issue16816] Bug in hash randomization

2012-12-30 Thread Charles-François Natali
Charles-François Natali added the comment: No, there's a bug in your code: nest_variables(collections.OrderedDict({'foo.bar': '1', 'foo': '2'})) You pass the OrderedDict *and already constructed dict*, so entries are inserted in a random order. Just use this and it'll work properly:

[issue16816] Bug in hash randomization

2012-12-30 Thread Charles-François Natali
Charles-François Natali added the comment: There's actually a parenthesis missing: nest_variables(collections.OrderedDict((('foo.bar', '1'), ('foo', '2' -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python

[issue16816] Bug in hash randomization

2012-12-30 Thread Domen Kožar
Domen Kožar added the comment: Ah, works much better if you pass tuple to ordereddict. Seems like a bug in my program indeed (I was using ordereddict, but not correctly). Sorry for the noise! -- ___ Python tracker rep...@bugs.python.org

[issue16816] Bug in hash randomization

2012-12-29 Thread Domen Kožar
New submission from Domen Kožar: Script to reproduce the issue https://gist.github.com/4409304 -- components: Interpreter Core messages: 178539 nosy: iElectric priority: normal severity: normal status: open title: Bug in hash randomization type: behavior versions: Python 3.3

[issue16816] Bug in hash randomization

2012-12-29 Thread Benjamin Peterson
Benjamin Peterson added the comment: You're relying on the iteration order of dictionaries being consistent. That's a bug in your program. -- nosy: +benjamin.peterson resolution: - invalid status: open - closed ___ Python tracker